Skip to content

Commit

Permalink
sub menu out of position swisnl#533
Browse files Browse the repository at this point in the history
  • Loading branch information
AliShahrivarian authored Sep 11, 2017
1 parent 8427585 commit c99690b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jquery.contextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1556,7 +1556,7 @@
if(menuHeight > winHeight){
$menu.css({
'height': winHeight -
(parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px',
((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px',
'overflow-x':'hidden',
'overflow-y':'auto',
'top':winScrollTop+'px'
Expand All @@ -1567,7 +1567,7 @@
});
} else if($menuOffset.top+menuHeight > winScrollTop + winHeight){
$menu.css({
'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -(parseInt($menu.css('padding-top'))+parseInt($menu.css('margin-top')))+'px'
'top':$menuOffset.top - Math.abs((winScrollTop+winHeight)-($menuOffset.top+menuHeight)) -((parseInt($menu.css('padding-top'))*2)+(parseInt($menu.css('margin-top'))*2))+'px'
});
}
if($menuOffset.left + menuWidth > winWidth){
Expand Down

0 comments on commit c99690b

Please sign in to comment.