[pve-devel] r5821 - in pve-manager/pve2/www/new: . panel
svn-commits at proxmox.com
svn-commits at proxmox.com
Tue Apr 19 09:39:37 CEST 2011
Author: dietmar
Date: 2011-04-19 09:39:37 +0200 (Tue, 19 Apr 2011)
New Revision: 5821
Modified:
pve-manager/pve2/www/new/StateProvider.js
pve-manager/pve2/www/new/panel/ConfigPanel.js
pve-manager/pve2/www/new/panel/StatusPanel.js
Log:
use itemId instead of tab index
Modified: pve-manager/pve2/www/new/StateProvider.js
===================================================================
--- pve-manager/pve2/www/new/StateProvider.js 2011-04-19 07:30:37 UTC (rev 5820)
+++ pve-manager/pve2/www/new/StateProvider.js 2011-04-19 07:39:37 UTC (rev 5821)
@@ -81,7 +81,7 @@
}
}
- //console.log("GET " + name + " " + text + " " + data);
+ // console.log("GET " + name + " " + Ext.encode(data));
return data;
},
Modified: pve-manager/pve2/www/new/panel/ConfigPanel.js
===================================================================
--- pve-manager/pve2/www/new/panel/ConfigPanel.js 2011-04-19 07:30:37 UTC (rev 5820)
+++ pve-manager/pve2/www/new/panel/ConfigPanel.js 2011-04-19 07:39:37 UTC (rev 5821)
@@ -18,17 +18,20 @@
items.unshift({
pveSelNode: me.pveSelNode,
id: 'search',
+ itemId: 'search',
border: false,
xtype: 'pveResourceGrid'
});
items.push({
border: false,
+ itemId: 'tab1',
title: "TAB1",
html: "test1"
});
items.push({
border: false,
+ itemId: 'tab2',
title: "TAB2",
html: "test2"
});
@@ -37,7 +40,8 @@
title: "NODE ID " + me.pveSelNode.data.id,
listeners: {
tabchange: function() {
- var state = { value: me.items.indexOf(me.getActiveTab()) };
+ var atab = me.getActiveTab().itemId;
+ var state = { value: atab };
sp.set(stateid, state);
}
},
@@ -46,16 +50,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 != ntab)) {
me.setActiveTab(ntab);
}
}
Modified: pve-manager/pve2/www/new/panel/StatusPanel.js
===================================================================
--- pve-manager/pve2/www/new/panel/StatusPanel.js 2011-04-19 07:30:37 UTC (rev 5820)
+++ pve-manager/pve2/www/new/panel/StatusPanel.js 2011-04-19 07:39:37 UTC (rev 5821)
@@ -43,7 +43,7 @@
if (key === stateid) {
var atab = me.getActiveTab().itemId;
var ntab = state.value;
- if (state && ntab && (atab != state.value)) {
+ if (state && ntab && (atab != ntab)) {
me.setActiveTab(ntab);
}
}
More information about the pve-devel
mailing list