]> git.proxmox.com Git - pve-manager.git/commitdiff
ext6migrate: remove redundant code to set the default active tab
authorEmmanuel Kasper <e.kasper@proxmox.com>
Mon, 30 Nov 2015 14:00:43 +0000 (15:00 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 22 Jan 2016 10:24:21 +0000 (11:24 +0100)
If the default activeTab is *undefined* and *not* null, activeTab defaults to 0,
so we don't need to set this explicitely.

dug from ExtJS tabPanel:
activeTab = me.activeTab !== null ? (me.activeTab || 0) : null;

www/manager6/panel/ConfigPanel.js

index 187856430190376c6a8f4041e3a4eff36bfc6ed5..fdab318edf60ed7657c3f44a0cdb2ee713d999e3 100644 (file)
@@ -9,7 +9,7 @@ Ext.define('PVE.panel.Config', {
 
        var sp = Ext.state.Manager.getProvider();
 
-       var activeTab;
+       var activeTab; // leaving this undefined means items[0] will be the default tab
 
        var hsregex =  /^([^\-\s]+)(-\S+)?$/;
 
@@ -67,12 +67,6 @@ Ext.define('PVE.panel.Config', {
            }),
            items: items,
            listeners: {
-               afterrender: function(tp) {
-                   var first =  tp.items.get(0);
-                   if (first) {
-                       first.fireEvent('show', first);
-                   }
-               },
                tabchange: function(tp, newcard, oldcard) {
                    var ntab = newcard.itemId;