aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/router.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/router.js')
-rw-r--r--www/js/router.js16
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;
}
})