diff options
author | Struan Donald <struan@exo.org.uk> | 2013-02-28 17:44:36 +0000 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-02-28 17:44:36 +0000 |
commit | 84da199efaa3b731c778aefa1fec132e1e6ca52f (patch) | |
tree | 234d2a108cbb1f8cad5fd2386c0171766e6fc7b5 /www/js | |
parent | ddcd2079efe426a2af4ce439f3710f5bdd328e6e (diff) |
add in details screen
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/app.js | 2 | ||||
-rw-r--r-- | www/js/router.js | 8 | ||||
-rw-r--r-- | www/js/views/details.js | 9 |
3 files changed, 17 insertions, 2 deletions
diff --git a/www/js/app.js b/www/js/app.js index 94ed26a..5595a08 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -38,7 +38,7 @@ var tpl = { ;(function (FMS, Backbone, _, $) { _.extend(FMS, { templates: [ - 'home', 'around', 'photo' + 'home', 'around', 'photo', 'details' ], initialized: 0, diff --git a/www/js/router.js b/www/js/router.js index 4c7430c..05b5d33 100644 --- a/www/js/router.js +++ b/www/js/router.js @@ -7,7 +7,8 @@ '': 'home', 'home': 'home', 'around': 'around', - 'photo': 'photo' + 'photo': 'photo', + 'details': 'details' }, initialize: function() { @@ -34,6 +35,11 @@ this.changeView(photoView); }, + details: function(){ + var detailsView = new FMS.DetailsView(); + this.changeView(detailsView); + }, + changeView: function(view) { console.log( 'change View to ' + view.id ); $(view.el).attr('data-role', 'page'); diff --git a/www/js/views/details.js b/www/js/views/details.js new file mode 100644 index 0000000..2c16c43 --- /dev/null +++ b/www/js/views/details.js @@ -0,0 +1,9 @@ +;(function (FMS, Backbone, _, $) { + _.extend( FMS, { + DetailsView: FMS.FMSView.extend({ + template: 'details', + id: 'details-page', + prev: 'photo' + }) + }); +})(FMS, Backbone, _, $); |