Commit 88f56408 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix links to class members.

Previously the window.location was changed every time a tab was
activated. This resulted in behaviour that when one was to follow
link to #/api/SomeClass-method-foo he would get the method opened,
but URL changed to #/api/SomeClass.
parent 5a59840e
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -105,7 +105,11 @@ Ext.define('Docs.controller.Tabs', {
        cmp.el.addListener('click', function(event, el) {
            cmp.justClosed = true;
            var docTab = Ext.get(el).up('.doctab');
            Ext.getCmp('doctabs').removeTab(docTab.down('.tabUrl').getAttribute('href'));
            var next = Ext.getCmp('doctabs').removeTab(docTab.down('.tabUrl').getAttribute('href'));
            if (next) {
                Ext.getCmp('doctabs').activateTab(next);
                Docs.History.push(next.replace(/#/, ""));
            }
            docTab.animate({
                to: { top: 30 }
            }).animate({
@@ -135,6 +139,7 @@ Ext.define('Docs.controller.Tabs', {
            }
            var url = Ext.get(el).down('.tabUrl').getAttribute('href');
            Ext.getCmp('doctabs').activateTab(url);
            Docs.History.push(url.replace(/#/, ""));
        }, this, {
            delegate: '.doctab'
        });
+4 −3
Original line number Diff line number Diff line
@@ -105,14 +105,14 @@ Ext.define('Docs.view.Tabs', {
                }
            }
        }
        window.location = url;
    },

    /**
     * Removes a tab from the tab bar. If the tab to be removed is the current tab,
     * activate the tab to the right.
     * returns url of the tab on the right.
     *
     * @param {String} url URL of the tab to remove
     * @return {String} URL of the tab to activate next, or undefined.
     */
    removeTab: function(url) {
        var idx = Ext.Array.indexOf(this.openTabs, url);
@@ -131,9 +131,10 @@ Ext.define('Docs.view.Tabs', {
                if (idx === this.openTabs.length) {
                    idx -= 1;
                }
                this.activateTab(this.openTabs[idx]);
                return this.openTabs[idx];
            }
        }
        return undefined;
    },

    // Determines controller name from URL