summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/settingsView.js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/static/js/views/settingsView.js')
-rw-r--r--module/web/static/js/views/settingsView.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/module/web/static/js/views/settingsView.js b/module/web/static/js/views/settingsView.js
index 5350f5a94..3b8308f19 100644
--- a/module/web/static/js/views/settingsView.js
+++ b/module/web/static/js/views/settingsView.js
@@ -19,6 +19,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ConfigHolder', './con
// currently open configHolder
config: null,
+ lastConfig: null,
isLoading: false,
@@ -56,6 +57,7 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ConfigHolder', './con
if (this.config && this.config.get('name') === name)
return;
+ this.lastConfig = this.config;
this.config = new ConfigHolder({name: name});
this.loading();
@@ -81,10 +83,16 @@ define(['jquery', 'underscore', 'backbone', 'app', 'models/ConfigHolder', './con
},
show: function() {
- // TODO: better cleaning of old views
- var oldHeight = this.content.height();
- this.content.empty();
+ // TODO animations are bit sloppy
this.content.css('display', 'block');
+ var oldHeight = this.content.height();
+
+ // this will destroy the old view
+ if (this.lastConfig)
+ this.lastConfig.trigger('destroy');
+ else
+ this.content.empty();
+
// reset the height
this.content.css('height', '');
// append the new element