From c58188e0e029a161a7181344b99d04219790bdc4 Mon Sep 17 00:00:00 2001 From: Chris Hallberg <crhallberg@gmail.com> Date: Wed, 6 Apr 2016 15:21:09 -0400 Subject: [PATCH] Add 25px of padding to the height normalization. Improves responsiveness and visuals. --- .../templates/RecordTab/similaritemscarousel.phtml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml b/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml index 1c75d365d4d..99cc5e98bd8 100644 --- a/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml +++ b/themes/bootstrap3/templates/RecordTab/similaritemscarousel.phtml @@ -57,7 +57,9 @@ <? endif; ?> <? $script = <<<JS +var normalizeHeightCount = $('#similar-items-carousel img').length; function normalizeHeights() { + if(--normalizeHeightCount > 0) return; var tallest = 0; var items = $('#similar-items-carousel .hover-overlay'); items.each(function() { //add heights to array @@ -65,9 +67,9 @@ function normalizeHeights() { tallest = $(this).height(); } }); - items.css('min-height',tallest + 'px'); + items.css('min-height', (tallest+25) + 'px'); } $('#similar-items-carousel img').load(normalizeHeights); JS; ?> -<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> \ No newline at end of file +<?=$this->inlineScript(\Zend\View\Helper\HeadScript::SCRIPT, $script, 'SET') ?> -- GitLab