diff options
Diffstat (limited to 'public/assets/js/lib/view/PaintingView.js')
| -rw-r--r-- | public/assets/js/lib/view/PaintingView.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/public/assets/js/lib/view/PaintingView.js b/public/assets/js/lib/view/PaintingView.js new file mode 100644 index 0000000..5c4f3bd --- /dev/null +++ b/public/assets/js/lib/view/PaintingView.js @@ -0,0 +1,36 @@ +var PaintingView = View.extend({ + + el: "body", + + // template: liquid($('#tmpl-about').html()), + + events: { + }, + + initialize: function(options){ + options = options || {} + var data = this.data = options.data + }, + + render: function(){ + if (this.rendered) return + this.rendered = true + }, + + show: function(){ + this.render(this.data) + document.body.className = "painting" + }, + + hide: function(){ + // document.body.className = "about" + }, + + load: function(id){ + var index = this.data.paintings.map(function(p){ return p.id }).indexOf(id) + if (index) { + $.fn.fullpage.moveTo(index+1) + } + }, + +}) |
