assets/themes/j1/adapter/js/slick.js in j1-template-2023.7.0 vs assets/themes/j1/adapter/js/slick.js in j1-template-2023.8.0

- old
+ new

@@ -255,21 +255,24 @@ imageMaxHeight: slickLightboxOptions.imageMaxHeight, lazy: slickLightboxOptions.lazy, }); } // END carousel lightbox enabled - logger.info('\n' + 'adjust positions of arrows on id: {{carousel.id}}'); + logger.info('\n' + 'adjust positions of slick lightbox arrows on id: {{carousel.id}}'); var buttons = $("#{{carousel.id}} > button"); + var arrowTopPos = Math.round(document.documentElement.clientHeight/2) - // recalculate right arrow position based on gutter settings + // jadams, 2023-09-01: not used anymore // - var percentage_right = 3 + carouselSettings.gutters; - $.each($(buttons), function(index, button) { - if (button.textContent.includes("Next")) { - $(button).attr('style','right: ' + percentage_right + '%'); - } - }); + // re-calculate right arrow position based on gutter settings + // var percentage_right = 3 + carouselSettings.gutters; + // $.each($(buttons), function(index, button) { + // + // if (button.textContent.includes("Next")) { + // $(button).attr('style', 'right: ' + percentage_right + '%'); + // } + // }); // add CSS style for individual top position for all carousels // if ($('#{{carousel.id}}_caption')) { logger.info('\n' + 'adjust top position of arrows on id: {{carousel.id}}'); @@ -308,12 +311,12 @@ const $slick = $('.{{carousel.id | replace: '_','-' }}'); const $slides = $slick.find('.slick-slide'); const $currentSlide = $slides.filter((index, slide) => $(slide).hasClass('slick-current')); if (carousel_type == 'example') { - slideImageHeight = ($currentSlide.find('{{carousel.style}}').height() / 2) - 25; + slideImageHeight = ($currentSlide.find('{{carousel.style}}').height()/2) - 25; } else { - slideImageHeight = ($currentSlide.find('img').height() / 2) - 20; + slideImageHeight = ($currentSlide.find('img').height()/2) - 25; } logger.info('\n' + 'adjust top arrow position (centered) by ' + slideImageHeight + ' on id: {{carousel.id}}'); $('.slick-arrow-{{carousel.id}}').css('top', slideImageHeight + 'px'); clearInterval(dependencies_met_page_ready);