Commit 39bd34eb authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Order all static/instance methods in hover menus.

Previously statics were at the end, which made it seemingly look like
the menu wasn't correctly sorted.

The good thing was that the menu ordering matched the page ordering,
but whether it really mattered, remains to be seen when people start
to complain about this change.

For now I'm opting for the simpler code and uniformity of ordering
required/optional and instance/static.
parent 2ef2aa88
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -60,13 +60,16 @@ Ext.define('Docs.view.cls.Toolbar', {
            css_mixin: "CSS Mixins"
        };
        for (var type in memberTitles) {
            var members = this.docClass.members[type];
            var statics = this.docClass.statics[type];
            if (members.length || statics.length) {
            // combine both static and instance members into one alphabetically sorted array
            var members = this.docClass.members[type].concat(this.docClass.statics[type]);
            members.sort(function(a, b) {
                return a.name < b.name ? -1 : (a.name > b.name ? 1 : 0);
            });
            if (members.length > 0) {
                var btn = this.createMemberButton({
                    text: memberTitles[type],
                    type: type,
                    members: members.concat(statics)
                    members: members
                });
                this.memberButtons[type] = btn;
                this.items.push(btn);