aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/router.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-02-28 12:02:40 +0000
committerStruan Donald <struan@exo.org.uk>2013-02-28 12:02:40 +0000
commitdf7de48f2eb5c4c6699273392296f87af628ea51 (patch)
tree66de6952a777df7618f84ad212969a0f0d982db8 /www/js/router.js
parent2ac9ca08ebc95fddb75b39813d7ed85f09bb92f3 (diff)
around page doing GPS locate and showing map
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;