Do not validate the model unnecessarily (when closing).

Clear the cache of a node, whenever an object has been removed of that
kind, it will allow us to fetch the latest list.
This commit is contained in:
Ashesh Vashi
2016-05-21 15:36:36 +05:30
parent d2eaa8b3dd
commit b2b6d443b5
2 changed files with 6 additions and 2 deletions

View File

@@ -212,7 +212,7 @@ function(_, pgAdmin, $, Backbone) {
if (obj) {
if (obj instanceof pgBrowser.DataModel) {
obj.reset();
obj.reset(opts);
delete obj;
} else if (obj instanceof Backbone.Model) {
obj.clear(opts);
@@ -233,7 +233,7 @@ function(_, pgAdmin, $, Backbone) {
}
}
}
this.clear({silent: true});
this.clear(opts);
},
sessChanged: function() {
var self = this;

View File

@@ -655,6 +655,10 @@ function($, _, S, pgAdmin, Menu, Backbone, Alertify, pgBrowser, Backform) {
return true;
},
removed: function(item) {
var self = this;
setTimeout(function() { self.clear_cache.apply(self, item); }, 0);
},
refresh: function(n, i) {
var self = this,
t = pgBrowser.tree,