From 2ac9ca08ebc95fddb75b39813d7ed85f09bb92f3 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 28 Feb 2013 11:07:48 +0000 Subject: WIP around page display --- www/js/router.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'www/js/router.js') 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; } }) -- cgit v1.2.3