From b2b6d443b5205ec3ce52bdfd273630a8a8a3f555 Mon Sep 17 00:00:00 2001 From: Ashesh Vashi Date: Sat, 21 May 2016 15:36:36 +0530 Subject: [PATCH] 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. --- web/pgadmin/browser/static/js/datamodel.js | 4 ++-- web/pgadmin/browser/templates/browser/js/node.js | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/browser/static/js/datamodel.js b/web/pgadmin/browser/static/js/datamodel.js index 147185bda..87b5a6455 100644 --- a/web/pgadmin/browser/static/js/datamodel.js +++ b/web/pgadmin/browser/static/js/datamodel.js @@ -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; diff --git a/web/pgadmin/browser/templates/browser/js/node.js b/web/pgadmin/browser/templates/browser/js/node.js index 70dcfb55b..b76afe8a0 100644 --- a/web/pgadmin/browser/templates/browser/js/node.js +++ b/web/pgadmin/browser/templates/browser/js/node.js @@ -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,