mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Automatically expand child nodes as well as the selected node on the treeview if there is only one. Fixes #3559
This also ensure the browser state is cleared if the save interval is set to -1.
This commit is contained in:
committed by
Dave Page
parent
438116c574
commit
17694ab467
@@ -999,8 +999,17 @@ define('pgadmin.browser.node', [
|
||||
});
|
||||
},
|
||||
opened: function(item) {
|
||||
let tree = pgBrowser.tree,
|
||||
auto_expand = pgBrowser.get_preference('browser', 'auto_expand_sole_children');
|
||||
|
||||
pgBrowser.Events.trigger('pgadmin:browser:tree:update-tree-state',
|
||||
item);
|
||||
|
||||
if (auto_expand && auto_expand.value == true && tree.children(item).length == 1) {
|
||||
// Automatically expand the child node, if a treeview node has only a single child.
|
||||
tree.open(tree.first(item));
|
||||
}
|
||||
|
||||
},
|
||||
closed: function(item) {
|
||||
pgBrowser.Events.trigger('pgadmin:browser:tree:remove-from-tree-state',
|
||||
|
||||
Reference in New Issue
Block a user