]> git.proxmox.com Git - proxmox-backup.git/commitdiff
ui: file browser: expand child node if only one archive present
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 25 Jun 2020 09:54:46 +0000 (11:54 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 25 Jun 2020 10:52:42 +0000 (12:52 +0200)
Get the first visible node through the Ext.data.NodeInterface defined
"firstChild" element and expand that if there's only one archive
present.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/window/FileBrowser.js

index d0d66f27acd23d570e77d66624094414b822d3f9..fb1c6b9f038508bc53f0c9640b15e3ceafe8ebd1 100644 (file)
@@ -142,8 +142,13 @@ Ext.define("PBS.window.FileBrowser", {
                'backup-type': view['backup-type'],
                'backup-time': view['backup-time'],
            });
-           store.load();
-           store.getRoot().expand();
+           store.load(() => {
+               let root = store.getRoot();
+               root.expand(); // always expand invisible root node
+               if (root.childNodes.length === 1) {
+                   root.firstChild.expand();
+               }
+           });
        },
 
        control: {