diff options
Diffstat (limited to 'public/assets/js/lib/ProjectView.js')
| -rw-r--r-- | public/assets/js/lib/ProjectView.js | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/public/assets/js/lib/ProjectView.js b/public/assets/js/lib/ProjectView.js index 97a7e1c..7e38d2a 100644 --- a/public/assets/js/lib/ProjectView.js +++ b/public/assets/js/lib/ProjectView.js @@ -9,10 +9,7 @@ var ProjectView = View.extend({ initialize: function(opt){ // this.gallery = new GalleryView () - this.project_id = this.$el.data("id") - this.page_number = opt.page_number - this.slide_count = this.$(".cell").length - + this.$iframes = this.$(".cell.iframe") this.$images = this.$(".cell.image") this.$videos = this.$(".cell.video") @@ -20,8 +17,17 @@ var ProjectView = View.extend({ this.images = this.$images.toArray().map(function(img){ return $(img).data("uri") }) if (is_mobile) { - $iframes.remove() - $videos.remove() + this.$iframes.remove() + this.$videos.remove() + this.$iframes = this.$videos = $(".nothing") + if (this.$(".mobile").length) { + this.$(".desktop").remove() + this.$(".mobile").removeClass("desktop") + } + } + else { + this.$(".mobile").remove() + this.$(".desktop").removeClass("desktop") } if (this.$(".cell").length > 1) { @@ -47,7 +53,12 @@ var ProjectView = View.extend({ this.$el.append( $("<figure>").addClass("page-up") ) this.$el.append( $("<figure>").addClass("page-down") ) } - + + // now that the gallery is ready, store this data.. + this.project_id = this.$el.data("id") + this.page_number = opt.page_number + this.slide_count = this.$(".cell").length + this.$el.addClass('hidden') }, |
