]> git.proxmox.com Git - proxmox-backup.git/blobdiff - www/NavigationTree.js
ui: navigation tree: fix losing datastore selection on store load
[proxmox-backup.git] / www / NavigationTree.js
index eea1d158d166583201b325a6857c2baf3c42b361..577310fd9219e7ac51e61bd50a59621211fb7210 100644 (file)
@@ -130,9 +130,10 @@ Ext.define('PBS.store.NavigationStore', {
 Ext.define('CustomTreeListItem', {
     extend: 'Ext.list.TreeItem',
     xtype: 'qtiptreelistitem',
-    updateNode: function(node, oldNode) {
+
+    nodeUpdate: function(node, modifiedFieldNames) {
+       this.callParent(arguments);
        const qtip = node ? node.get('qtip') : null;
-       this.callParent([node, oldNode]);
        if (qtip) {
            this.element.dom.setAttribute('data-qtip', qtip);
        } else {
@@ -261,17 +262,18 @@ Ext.define('PBS.view.main.NavigationTree', {
                    iconCls = 'fa fa-database pmx-tree-icon-custom maintenance';
                }
 
-               const child = {
-                   text: name,
-                   qtip,
-                   path: `DataStore-${name}`,
-                   iconCls,
-                   leaf: true,
-               };
                if (getChildTextAt(j).localeCompare(name) !== 0) {
-                   list.insertChild(j, child);
+                   list.insertChild(j, {
+                       text: name,
+                       qtip,
+                       path: `DataStore-${name}`,
+                       iconCls,
+                       leaf: true,
+                   });
                } else {
-                   list.replaceChild(child, list.getChildAt(j));
+                   let oldChild = list.getChildAt(j);
+                   oldChild.set('qtip', qtip);
+                   oldChild.set('iconCls', iconCls);
                }
            }