Fixed an issue where the F2 Function key removes browser panel contents. Fixes #7126

This commit is contained in:
Nikhil Mohite
2022-01-28 10:55:23 +05:30
committed by Akshay Joshi
parent 8f7b30075e
commit 37d82d457c
3 changed files with 14 additions and 8 deletions

View File

@@ -1269,14 +1269,19 @@ define('pgadmin.browser', [
// If there is no parent then just update the node
if(this.t.isRootNode(_parent) ||
(_parent && _parent.length == 0 && ctx.op == 'UPDATE')) {
var that = this;
this.t.remove(this.i).then(() => {
that.t.before(that.i, that.new).then((new_item) => {
that.t.select(new_item);
}, () => {
console.warn('Failed to add before..', arguments);
//Update node if browser has single child node.
if(this.t.children().length === 1) {
updateNode();
} else {
var that = this;
this.t.remove(this.i).then(() => {
that.t.before(that.i, that.new).then((new_item) => {
that.t.select(new_item);
}, () => {
console.warn('Failed to add before..', arguments);
});
});
});
}
} else {
var postRemove = function() {
// If item has parent but no grand parent