aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/router.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/router.js')
-rw-r--r--www/js/router.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/www/js/router.js b/www/js/router.js
index 2217c9b..5327a1c 100644
--- a/www/js/router.js
+++ b/www/js/router.js
@@ -29,13 +29,14 @@
},
changeView: function(view) {
+ console.log( 'change View to ' + view.id );
$(view.el).attr('data-role', 'page');
view.render();
$('body').append($(view.el));
$.mobile.changePage($(view.el), { changeHash: false });
+
if(!_.isNull(this.currentView)) {
- var oldView = this.currentView;
- oldView.destroy();
+ this.currentView.destroy();
}
view.afterDisplay();
this.currentView = view;