From 4bd789b0fa2e28750835508e30808c78630cb0e0 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 25 Jun 2020 11:54:46 +0200 Subject: [PATCH] ui: file browser: expand child node if only one archive present 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 --- www/window/FileBrowser.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/www/window/FileBrowser.js b/www/window/FileBrowser.js index d0d66f27..fb1c6b9f 100644 --- a/www/window/FileBrowser.js +++ b/www/window/FileBrowser.js @@ -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: {