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
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -108,16 +108,9 @@ Ext.define('Docs.view.cls.PackageLogic', {

    // Utility method that given full package or class name extracts
    // 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) {
      var parts = name.split(/\./);
      var srt = parts.pop();
      while (parts.length > 1 && /^[A-Z]/.test(parts[parts.length-1])) {
        srt = parts.pop() + "." + srt;
      }
      return srt;
      return parts.pop();
    }

});