Commit c50ec3a2 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Use names when switching trees, not magic numbers.

parent fb1ff691
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ Ext.define('Docs.controller.Classes', {
        this.getViewport().setPageTitle("");
        Ext.getCmp('doctabs').activateTab('#/api');
        Ext.getCmp('tree-container').show();
        Ext.getCmp('tree-container').layout.setActiveItem(0);
        Ext.getCmp('tree-container').layout.setActiveItem('classtree');
        Ext.getCmp('card-panel').layout.setActiveItem('classindex');
    },

@@ -177,7 +177,7 @@ Ext.define('Docs.controller.Classes', {

        Ext.getCmp('card-panel').layout.setActiveItem('classcontainer');
        Ext.getCmp('tree-container').show();
        Ext.getCmp('tree-container').layout.setActiveItem(0);
        Ext.getCmp('tree-container').layout.setActiveItem('classtree');

        if (this.activeUrl === url) {
            this.scrollContent();
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ Ext.define('Docs.controller.Examples', {
    loadIndex: function() {
        Ext.getCmp('doctabs').activateTab('#/example');
        Ext.getCmp('card-panel').layout.setActiveItem('examples');
        Ext.getCmp('tree-container').layout.setActiveItem(1);
        Ext.getCmp('tree-container').layout.setActiveItem('exampletree');
        Ext.getCmp('tree-container').show();
    },

@@ -59,7 +59,7 @@ Ext.define('Docs.controller.Examples', {

    activateExampleCard: function() {
        Ext.getCmp('card-panel').layout.setActiveItem('example');
        Ext.getCmp('tree-container').layout.setActiveItem(1);
        Ext.getCmp('tree-container').layout.setActiveItem('exampletree');
        Ext.getCmp('tree-container').show();
    }
});
+2 −2
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ Ext.define('Docs.controller.Guides', {
        Ext.getCmp('doctabs').activateTab('#/guide');
        Ext.getCmp('card-panel').layout.setActiveItem('guides');
        Ext.getCmp('tree-container').show();
        Ext.getCmp('tree-container').layout.setActiveItem(2);
        Ext.getCmp('tree-container').layout.setActiveItem('guidetree');
    },

    /**
@@ -94,7 +94,7 @@ Ext.define('Docs.controller.Guides', {
    loadGuide: function(url, noHistory) {
        Ext.getCmp('card-panel').layout.setActiveItem('guide');
        Ext.getCmp('tree-container').show();
        Ext.getCmp('tree-container').layout.setActiveItem(2);
        Ext.getCmp('tree-container').layout.setActiveItem('guidetree');

        if (this.activeUrl === url) {
            return this.scrollContent();
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ Ext.define('Docs.controller.Videos', {
    loadIndex: function() {
        Ext.getCmp('doctabs').activateTab('#/video');
        Ext.getCmp('card-panel').layout.setActiveItem('videos');
        Ext.getCmp('tree-container').layout.setActiveItem(3);
        Ext.getCmp('tree-container').layout.setActiveItem('videotree');
        Ext.getCmp('tree-container').show();
    },

@@ -54,7 +54,7 @@ Ext.define('Docs.controller.Videos', {

    activateVideoCard: function() {
        Ext.getCmp('card-panel').layout.setActiveItem('video');
        Ext.getCmp('tree-container').layout.setActiveItem(3);
        Ext.getCmp('tree-container').layout.setActiveItem('videotree');
        Ext.getCmp('tree-container').show();
    },

+7 −3
Original line number Diff line number Diff line
@@ -79,16 +79,20 @@ Ext.define('Docs.view.Viewport', {
                        items: [
                            {
                                xtype: 'classtree',
                                id: 'classtree',
                                root: Docs.data.classes
                            },
                            {
                                xtype: 'exampletree'
                                xtype: 'exampletree',
                                id: 'exampletree'
                            },
                            {
                                xtype: 'guidetree'
                                xtype: 'guidetree',
                                id: 'guidetree'
                            },
                            {
                                xtype: 'videotree'
                                xtype: 'videotree',
                                id: 'videotree'
                            }
                        ]
                    },