mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Using better way to find the current object in the properties panel.
This commit is contained in:
parent
8b35a60c08
commit
417af3676d
@ -92,23 +92,12 @@ function($, _, S, pgAdmin, Backbone, Alertify, Backform) {
|
||||
|
||||
if (view) {
|
||||
// Avoid unnecessary reloads
|
||||
var n_type = data._type,
|
||||
n_value = -1,
|
||||
treeHierarchy = n.getTreeNodeHierarchy(item);
|
||||
|
||||
if (_.isUndefined(treeHierarchy[n_type]) ||
|
||||
_.isUndefined(treeHierarchy[n_type]._id)) {
|
||||
n_value = -1;
|
||||
} else {
|
||||
n_value = treeHierarchy[n_type]._id;
|
||||
}
|
||||
|
||||
if (n_value == $(panel).data(n_type)) {
|
||||
if (_.isEqual($(panel).data('node-prop'), urlBase)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Cache the current IDs for next time
|
||||
$(panel).data(n_type, n_value);
|
||||
$(panel).data('node-prop', urlBase);
|
||||
|
||||
// Reset the data object
|
||||
j.data('obj-view', null);
|
||||
|
@ -797,19 +797,12 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
|
||||
n = i && d && pgBrowser.Nodes[d._type],
|
||||
treeHierarchy = n.getTreeNodeHierarchy(i);
|
||||
|
||||
if (_.isUndefined(treeHierarchy[n_type]) ||
|
||||
_.isUndefined(treeHierarchy[n_type]._id)) {
|
||||
n_value = -1;
|
||||
} else {
|
||||
n_value = treeHierarchy[n_type]._id;
|
||||
}
|
||||
|
||||
if (n_value == $(panel).data(n_type)) {
|
||||
if (_.isEqual($(panel).data('node-prop'), treeHierarchy)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Cache the current IDs for next time
|
||||
$(panel).data(n_type, n_value);
|
||||
$(panel).data('node-prop', treeHierarchy);
|
||||
|
||||
if (!content.hasClass('has-pg-prop-btn-group'))
|
||||
content.addClass('has-pg-prop-btn-group');
|
||||
|
Loading…
Reference in New Issue
Block a user