Skip to content
Snippets Groups Projects
Commit aad238b0 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Treat all package names equally when rendering tree.

This is a switch away from ext-doc style tree-logic where the tree
could look like this:

    - Foo
      - Bar
      - Bar.Baz
      - Bar.Zap

Now the tree always looks like this:

    - Foo
      - Bar
        - Baz
        - Zap

This change is mostly in response to request of a user working with
a system where most package names were also classes.  With previous
PackageLogic implementation he ended up with a pretty flat tree.
parent c56b12c1
No related branches found
No related tags found
No related merge requests found
...@@ -108,16 +108,9 @@ Ext.define('Docs.view.cls.PackageLogic', { ...@@ -108,16 +108,9 @@ Ext.define('Docs.view.cls.PackageLogic', {
// Utility method that given full package or class name extracts // Utility method that given full package or class name extracts
// the "class"-part of the name. // the "class"-part of the name.
//
// Because we try to emulate ext-doc, it's not as simple as just
// taking the last part.
shortName: function(name) { shortName: function(name) {
var parts = name.split(/\./); var parts = name.split(/\./);
var srt = parts.pop(); return parts.pop();
while (parts.length > 1 && /^[A-Z]/.test(parts[parts.length-1])) {
srt = parts.pop() + "." + srt;
}
return srt;
} }
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment