diff options
Diffstat (limited to 'www/js/views')
-rw-r--r-- | www/js/views/fms.js | 31 | ||||
-rw-r--r-- | www/js/views/home.js | 9 |
2 files changed, 40 insertions, 0 deletions
diff --git a/www/js/views/fms.js b/www/js/views/fms.js new file mode 100644 index 0000000..45eeabf --- /dev/null +++ b/www/js/views/fms.js @@ -0,0 +1,31 @@ +;(function (FMS, Backbone, _, $) { + _.extend( FMS, { + FMSView: Backbone.View.extend({ + + render: function(){ + if ( !this.template ) { + console.log('no template to render'); + return; + } + template = _.template( tpl.get( this.template ) ); + if ( this.model ) { + this.$el.html(template(this.model.toJSON())); + } else { + this.$el.html(template()); + } + this.afterRender(); + return this; + }, + + afterRender: function() {}, + + onClickButtonPrev: function() { + this.navigate( this.prev, 'right' ); + }, + + onClickButtonNext: function() { + this.navigate( this.next, 'left' ); + }, + }) + }); +})(FMS, Backbone, _, $); diff --git a/www/js/views/home.js b/www/js/views/home.js new file mode 100644 index 0000000..644754d --- /dev/null +++ b/www/js/views/home.js @@ -0,0 +1,9 @@ +;(function (FMS, Backbone, _, $) { + _.extend( FMS, { + HomeView: FMS.FMSView.extend({ + template: 'home', + tag: 'div', + id: 'front-page' + }) + }); +})(FMS, Backbone, _, $); |