diff options
Diffstat (limited to 'public/assets/js')
| -rw-r--r-- | public/assets/js/app.js | 21 | ||||
| -rw-r--r-- | public/assets/js/lib/ProjectView.js | 2 |
2 files changed, 13 insertions, 10 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js index bfd317b..504375b 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -68,9 +68,12 @@ var app = (function() { debounce(function() { $(".item").addClass("hidden") setTimeout(function(){ - $(".cell, .next, .previous").css({ 'height': ($(".top").height() + 'px'), 'display': 'inline-block' }) + $(".item").each(function(i){ + var height = window.innerHeight - $(this).find(".bottom").height() + $(".previous, .next, .cell, .top, .flickity-viewport", this).css({ 'height': height }) + }) app.view.$el.removeClass("hidden") - $('.top').flickity('resize') + // $('.top').flickity('resize') $('body').removeClass('resizing') }, 20) }, 400) @@ -81,10 +84,10 @@ var app = (function() { })() var heights = [] -$(".top").each(function(i){ - var height = $(this).height() - heights[i] = height - $(".cell", this).css({ 'height': (height + 'px') }) +$(".item").each(function(i){ + var height = window.innerHeight - $(this).find(".bottom").height() + console.log(height) + $(".cell, .top", this).css({ 'height': height }) }) $('.top').flickity(app.flickity_options).on( 'cellSelect', function(e) { @@ -92,9 +95,9 @@ $('.top').flickity(app.flickity_options).on( 'cellSelect', function(e) { app.header.updateSlideNumber( gallery.selectedIndex ) }) -$(".top").each(function(i){ - var height = heights[i] - $(".previous, .next", this).css({ 'height': (height + 'px') }) +$(".item").each(function(i){ + var height = window.innerHeight - $(this).find(".bottom").height() + $(".previous, .next, .flickity-viewport", this).css({ 'height': height }) }) $(".item").addClass("hidden") diff --git a/public/assets/js/lib/ProjectView.js b/public/assets/js/lib/ProjectView.js index 1528f10..107c3d5 100644 --- a/public/assets/js/lib/ProjectView.js +++ b/public/assets/js/lib/ProjectView.js @@ -12,7 +12,7 @@ var ProjectView = View.extend({ this.project_id = this.$el.data("id") this.page_number = opt.page_number console.log("INIT", this.project_id) - $("<div>").addClass("page-up").insertBefore( this.$(".flickity-viewport") ) + $("<div>").addClass("page-up").insertAfter( this.$(".flickity-viewport") ) $("<div>").addClass("page-down").insertAfter( this.$(".flickity-viewport") ) }, |
