diff options
author | Struan Donald <struan@exo.org.uk> | 2013-02-28 17:01:10 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-02-28 17:01:10 +0000 |
commit | e481a7fd383e041cd6be4f262a4dcc40b3e5a744 (patch) | |
tree | 6abd5f1866a3b9b48ed18ed45c21e44cc05c5247 /www/js/router.js | |
parent | df7de48f2eb5c4c6699273392296f87af628ea51 (diff) |
add in photo page and navigation to page
also used jquery mobile pageshow/hide events instead of our own
Diffstat (limited to 'www/js/router.js')
-rw-r--r-- | www/js/router.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/www/js/router.js b/www/js/router.js index 5327a1c..4c7430c 100644 --- a/www/js/router.js +++ b/www/js/router.js @@ -6,7 +6,8 @@ routes: { '': 'home', 'home': 'home', - 'around': 'around' + 'around': 'around', + 'photo': 'photo' }, initialize: function() { @@ -28,17 +29,22 @@ this.changeView(homeView); }, + photo: function(){ + var photoView = new FMS.PhotoView(); + this.changeView(photoView); + }, + changeView: function(view) { console.log( 'change View to ' + view.id ); $(view.el).attr('data-role', 'page'); + if ( view.prev ) { + $(view.el).attr('data-add-back-btn', 'true'); + } view.render(); $('body').append($(view.el)); $.mobile.changePage($(view.el), { changeHash: false }); - if(!_.isNull(this.currentView)) { - this.currentView.destroy(); - } - view.afterDisplay(); + console.log('changed View to ' + view.id); this.currentView = view; } }) |