mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixes #2321 - [Browser Tree] Shows only the newly created node (not, all
other child node) of a parent node, when it has not been already loaded. In order to resolve the issue - we will open the parent, and select the created node, instead of adding it to parent node.
This commit is contained in:
parent
d55b8394cf
commit
3dba7d8303
@ -965,14 +965,25 @@ function(require, $, _, S, Bootstrap, pgAdmin, Alertify, CodeMirror) {
|
|||||||
var i = $(options.items[0]);
|
var i = $(options.items[0]);
|
||||||
// Open the item path only if its parent is loaded
|
// Open the item path only if its parent is loaded
|
||||||
// or parent type is same as nodes
|
// or parent type is same as nodes
|
||||||
if(_parent_data._type.search(_data._type) > -1 ||
|
if(
|
||||||
is_parent_loaded_before) {
|
is_parent_loaded_before &&
|
||||||
|
_parent_data && _parent_data._type.search(
|
||||||
|
_data._type
|
||||||
|
) > -1
|
||||||
|
) {
|
||||||
ctx.t.openPath(i);
|
ctx.t.openPath(i);
|
||||||
ctx.t.select(i);
|
ctx.t.select(i);
|
||||||
} else {
|
} else {
|
||||||
// Unload the parent node so that we'll get
|
if (_parent_data) {
|
||||||
// latest data when we try to expand it
|
// Unload the parent node so that we'll get
|
||||||
ctx.t.unload(ctx.i);
|
// latest data when we try to expand it
|
||||||
|
ctx.t.unload(ctx.i, {
|
||||||
|
success: function (item, options) {
|
||||||
|
// Lets try to load it now
|
||||||
|
ctx.t.open(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
ctx.o && ctx.o.success &&
|
ctx.o && ctx.o.success &&
|
||||||
|
Loading…
Reference in New Issue
Block a user