diff options
Diffstat (limited to 'public/assets/js')
| -rw-r--r-- | public/assets/js/app.js | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 2151dab..f8c8025 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -63,17 +63,14 @@ var app = (function() { } app.resize = function(){ - $(".active .cell,.active .next,.active .previous").css({ 'display': 'none' }) + $(".active .gallery .cell,.active .next,.active .gallery .previous").css({ 'display': 'none' }) $('body').addClass('resizing') debounce(function() { $(".active.item").addClass("hidden") setTimeout(function(){ - $(".item").each(function(i){ - var height = window.innerHeight - $(this).find(".bottom").height() - $(".previous, .next, .cell, .top, .flickity-viewport", this).css({ 'height': height }) - }) + $(".active .gallery.cell,.active .gallery .next,.active .gallery .previous").css({ 'height': ($(".active .gallery.top").height() + 'px'), 'display': 'inline-block' }) app.view.$el.removeClass("hidden") - // $('.top').flickity('resize') + $('.active .gallery.top').flickity('resize') $('body').removeClass('resizing') }, 400) }, 400) @@ -84,20 +81,20 @@ var app = (function() { })() var heights = [] -$(".item").each(function(i){ - var height = window.innerHeight - $(this).find(".bottom").height() - console.log(height) - $(".cell, .top", this).css({ 'height': height }) +$(".top").each(function(i){ + var height = $(this).height() + heights[i] = height + $(".cell", this).css({ 'height': (height + 'px') }) }) -$('.top').flickity(app.flickity_options).on( 'cellSelect', function(e) { +$('.gallery.top').flickity(app.flickity_options).on( 'cellSelect', function(e) { var gallery = $(e.target).data('flickity') app.header.updateSlideNumber( gallery.selectedIndex ) }) -$(".item").each(function(i){ - var height = window.innerHeight - $(this).find(".bottom").height() - $(".previous, .next, .flickity-viewport", this).css({ 'height': height }) +$(".top").each(function(i){ + var height = heights[i] + $(".previous, .next", this).css({ 'height': (height + 'px') }) }) $(".item").addClass("hidden") |
