diff options
author | Struan Donald <struan@exo.org.uk> | 2013-02-28 12:02:40 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-02-28 12:02:40 +0000 |
commit | df7de48f2eb5c4c6699273392296f87af628ea51 (patch) | |
tree | 66de6952a777df7618f84ad212969a0f0d982db8 /www/js/router.js | |
parent | 2ac9ca08ebc95fddb75b39813d7ed85f09bb92f3 (diff) |
around page doing GPS locate and showing map
Diffstat (limited to 'www/js/router.js')
-rw-r--r-- | www/js/router.js | 5 |
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; |