diff options
Diffstat (limited to 'www/js/views/fms.js')
-rw-r--r-- | www/js/views/fms.js | 31 |
1 files changed, 31 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, _, $); |