Skip to content

Commit fb41ba7

Browse files
sub menu out of position #533
1 parent 8427585 commit fb41ba7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/jquery.contextMenu.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1556,7 +1556,7 @@
15561556
if(menuHeight > winHeight){
15571557
$menu.css({
15581558
'height': winHeight -
1559-
(parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px',
1559+
((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px',
15601560
'overflow-x':'hidden',
15611561
'overflow-y':'auto',
15621562
'top':winScrollTop+'px'
@@ -1567,7 +1567,7 @@
15671567
});
15681568
} else if($menuOffset.top+menuHeight > winScrollTop + winHeight){
15691569
$menu.css({
1570-
'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -(parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px'
1570+
'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px'
15711571
});
15721572
}
15731573
if($menuOffset.left + menuWidth > winWidth){

0 commit comments

Comments
 (0)