diff options
Diffstat (limited to 'public/assets/js/lib/ProjectView.js')
| -rw-r--r-- | public/assets/js/lib/ProjectView.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/public/assets/js/lib/ProjectView.js b/public/assets/js/lib/ProjectView.js index 02d7d4e..e735c81 100644 --- a/public/assets/js/lib/ProjectView.js +++ b/public/assets/js/lib/ProjectView.js @@ -1,13 +1,13 @@ var ProjectView = View.extend({ events: { - "click": "next", + "click": "nextOrCloseNav", "click .page-up": "previous", "click .page-down": "next", }, initialize: function(opt){ - this.gallery = new GalleryView () + // this.gallery = new GalleryView () this.project_id = this.$el.data("id") this.page_number = opt.page_number console.log("INIT", this.project_id) @@ -21,6 +21,13 @@ var ProjectView = View.extend({ app.header.updateSlideCount( 1 ) $('body').removeClass('navopen') this.$el.removeClass("hidden") + + if (this.project_id == "cover") { + app.router.pushState("/") + } + else { + app.router.pushState("/project/" + this.project_id) + } this.showing = true addClassForPeriod( this.el, "showing", 200, function(){ @@ -39,9 +46,14 @@ var ProjectView = View.extend({ app.nav.previous() }, - next: function(e){ + nextOrCloseNav: function(e){ e.stopPropagation() - app.nav.next() + if ($('body').hasClass('navopen')) { + $('body').removeClass('navopen') + } + else { + app.nav.next() + } }, }) |
