[pve-devel] r5820 - pve-manager/pve2/www/new/panel

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Apr 19 09:30:37 CEST 2011


Author: dietmar
Date: 2011-04-19 09:30:37 +0200 (Tue, 19 Apr 2011)
New Revision: 5820

Modified:
   pve-manager/pve2/www/new/panel/StatusPanel.js
Log:
save itemId instead of tab index


Modified: pve-manager/pve2/www/new/panel/StatusPanel.js
===================================================================
--- pve-manager/pve2/www/new/panel/StatusPanel.js	2011-04-19 06:56:18 UTC (rev 5819)
+++ pve-manager/pve2/www/new/panel/StatusPanel.js	2011-04-19 07:30:37 UTC (rev 5820)
@@ -15,15 +15,18 @@
 	Ext.apply(me, {
 	    listeners: {
 		tabchange: function() {
-		    var state = { value: me.items.indexOf(me.getActiveTab()) };
+		    var atab = me.getActiveTab().itemId;
+		    var state = { value: atab };
 		    sp.set(stateid, state);
 		}
 	    },
 	    items: [
 		{
+		    itemId: 'clog',
 		    title: 'Cluster log'
 		},
 		{
+		    itemId: 'tasks',
 		    title: 'Recent tasks'
 		}
 	    ]
@@ -31,16 +34,16 @@
 
 	var state = sp.get(stateid);
 	if (state && state.value) {
-	    me.activeTab = parseInt(state.value);
+	    me.activeTab = state.value;
 	}
 
 	me.callParent();
 
 	var statechange = function(sp, key, state) {
 	    if (key === stateid) {
-		var atab = me.items.indexOf(me.getActiveTab());
-		var ntab = parseInt(state.value);
-		if (state && (ntab >= 0) && (atab != state.value)) {
+		var atab = me.getActiveTab().itemId;
+		var ntab = state.value;
+		if (state && ntab && (atab != state.value)) {
 		    me.setActiveTab(ntab);
 		}
 	    }




More information about the pve-devel mailing list