[pve-devel] [PATCH manager 5/7] ext6migrate: avoid using id

Dominik Csapak d.csapak at proxmox.com
Fri Mar 11 15:57:32 CET 2016


since id should be unique for the whole dom,
avoid using it

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
this is necessary for the patch 6/7,
since we then load the new content before destroying the old
leaving sometimes 2 of the same for a short time
 www/manager6/VNCConsole.js       | 2 +-
 www/manager6/dc/RoleView.js      | 4 ++--
 www/manager6/lxc/SnapshotTree.js | 7 +++++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/www/manager6/VNCConsole.js b/www/manager6/VNCConsole.js
index 34a3c39..3712fb9 100644
--- a/www/manager6/VNCConsole.js
+++ b/www/manager6/VNCConsole.js
@@ -29,7 +29,7 @@ Ext.define('PVE.noVncConsole', {
 
 	// always use same iframe, to avoid running several noVnc clients
 	// at same time (to avoid performance problems)
-	var box = Ext.create('Ext.ux.IFrame', { id : "vncconsole" });
+	var box = Ext.create('Ext.ux.IFrame', { itemid : "vncconsole" });
 
 	Ext.apply(me, {
 	    items: box,
diff --git a/www/manager6/dc/RoleView.js b/www/manager6/dc/RoleView.js
index 066d2e1..26a241f 100644
--- a/www/manager6/dc/RoleView.js
+++ b/www/manager6/dc/RoleView.js
@@ -43,7 +43,7 @@ Ext.define('PVE.dc.RoleView', {
 		    dataIndex: 'roleid'
 		},
 		{
-		    id: 'privs',
+		    itemid: 'privs',
 		    header: gettext('Privileges'),
 		    sortable: false,
 		    renderer: render_privs,
@@ -60,4 +60,4 @@ Ext.define('PVE.dc.RoleView', {
 
 	me.callParent();
     }
-});
\ No newline at end of file
+});
diff --git a/www/manager6/lxc/SnapshotTree.js b/www/manager6/lxc/SnapshotTree.js
index e654df4..76e816c 100644
--- a/www/manager6/lxc/SnapshotTree.js
+++ b/www/manager6/lxc/SnapshotTree.js
@@ -79,7 +79,10 @@ Ext.define('PVE.lxc.SnapshotTree', {
 	    success: function(response, options) {
 		var res = response.result.data;
 		if (res.hasFeature) {
-		   Ext.getCmp('snapshotBtn').enable();
+		    var snpBtns = Ext.ComponentQuery.query('#snapshotBtn');
+		    snpBtns.forEach(function(item){
+			item.enable();
+		    });
 		}
 	    }
 	});
@@ -208,7 +211,7 @@ Ext.define('PVE.lxc.SnapshotTree', {
 	});
 
 	var snapshotBtn = Ext.create('Ext.Button', {
-	    id: 'snapshotBtn',
+	    itemId: 'snapshotBtn',
 	    text: gettext('Take Snapshot'),
 	    disabled: true,
 	    handler: function() {
-- 
2.1.4





More information about the pve-devel mailing list