var ProjectView = View.extend({ events: { "click": "next", "click .page-up": "previous", "click .page-down": "next", }, initialize: function(opt){ this.gallery = new GalleryView () this.project_id = this.$el.data("id") this.page_number = opt.page_number console.log("INIT", this.project_id) $("
").addClass("page-up").insertBefore( this.$(".flickity-viewport") ) $("
").addClass("page-down").insertAfter( this.$(".flickity-viewport") ) }, show: function(){ app.header.updatePageNumber( this.page_number ) app.header.updateSlideNumber( 0 ) app.header.updateSlideCount( 1 ) $('body').removeClass('navopen') this.$el.removeClass("hidden") this.showing = true addClassForPeriod( this.el, "showing", 200, function(){ this.showing = false }.bind(this) ) }, hide: function(){ addClassForPeriod( this.el, "hiding", 200, function(){ this.$el.addClass("hidden") }.bind(this) ) }, previous: function(e){ e.stopPropagation() app.nav.previous() }, next: function(e){ e.stopPropagation() app.nav.next() }, })