diff options
Diffstat (limited to 'www/js/router.js')
-rw-r--r-- | www/js/router.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/www/js/router.js b/www/js/router.js index 777acd9..2217c9b 100644 --- a/www/js/router.js +++ b/www/js/router.js @@ -6,6 +6,7 @@ routes: { '': 'home', 'home': 'home', + 'around': 'around' }, initialize: function() { @@ -17,6 +18,11 @@ } }, + around: function(){ + var aroundView = new FMS.AroundView(); + this.changeView(aroundView); + }, + home: function(){ var homeView = new FMS.HomeView(); this.changeView(homeView); @@ -27,6 +33,11 @@ view.render(); $('body').append($(view.el)); $.mobile.changePage($(view.el), { changeHash: false }); + if(!_.isNull(this.currentView)) { + var oldView = this.currentView; + oldView.destroy(); + } + view.afterDisplay(); this.currentView = view; } }) |