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
@@ -69,7 +69,27 @@ _.extend(pgBrowser.browserTreeState, {
|
||||
this.remove_from_cache, this);
|
||||
pgBrowser.Events.on('pgadmin:browser:tree:update-tree-state',
|
||||
this.update_cache, this);
|
||||
} else {
|
||||
$.ajax({
|
||||
url: url_for('settings.reset_tree_state'),
|
||||
type: 'DELETE',
|
||||
})
|
||||
.fail(function(jqx) {
|
||||
var msg = jqx.responseText;
|
||||
/* Error from the server */
|
||||
if (jqx.status == 417 || jqx.status == 410 || jqx.status == 500) {
|
||||
try {
|
||||
var data = JSON.parse(jqx.responseText);
|
||||
msg = data.errormsg;
|
||||
} catch (e) {
|
||||
console.warn(e.stack || e);
|
||||
}
|
||||
}
|
||||
console.warn(
|
||||
gettext('Error resetting the tree saved state."'), msg);
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
save_state: function() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user