Skip to content

Commit 7f7dddd

Browse files
committed
fixed last-card-menu scroll bug
1 parent c78dcd5 commit 7f7dddd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

www/scripts/sepiaFW.ui.cards.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,15 +1381,15 @@ function sepiaFW_build_ui_cards(){
13811381
//avoid that the menu is hidden behind control when at bottom of results view
13821382
if ($contextMenu.is(":last-child")){
13831383
var $container = $contextMenu.closest('.sepiaFW-cards-flexSize-container');
1384-
if ($container.is(":last-child")){
1385-
if ($container.parent().hasClass('.sepiaFW-results-container') || $container.parent().is(":last-child")){
1386-
//scroll down another 60px
1387-
setTimeout(function(){
1388-
var $scrollContainer = $container.closest('.sepiaFW-results-container');
1389-
var y = $scrollContainer.scrollTop();
1390-
$scrollContainer.animate({ scrollTop: y + 60 }, animTime);
1391-
}, animTime + 50);
1392-
}
1384+
var $lastVisibleChildInScrollParent = $container.closest('.sepiaFW-results-container').children().filter(":visible").last();
1385+
var $lastVisibleParentChild = $container.parent().children().filter(":visible").last();
1386+
if (($container.is($lastVisibleParentChild) && $container.parent().is($lastVisibleChildInScrollParent)) || $container.is($lastVisibleChildInScrollParent)){
1387+
//scroll down another 60px
1388+
setTimeout(function(){
1389+
var $scrollContainer = $container.closest('.sepiaFW-results-container');
1390+
var y = $scrollContainer.scrollTop();
1391+
$scrollContainer.animate({ scrollTop: y + 60 }, animTime);
1392+
}, animTime + 50);
13931393
}
13941394
}
13951395
}else{

0 commit comments

Comments
 (0)