mirror of
https://github.com/xdan/datetimepicker.git
synced 2024-11-18 06:24:22 +00:00
Merge pull request #77 from Olek89/fix/position-above-the-page-top
Do not scroll over the document top edge
This commit is contained in:
commit
9dc632f504
@ -988,6 +988,8 @@
|
||||
var offset = datetimepicker.data('input').offset(), top = offset.top+datetimepicker.data('input')[0].offsetHeight-1, left = offset.left;
|
||||
if( top+datetimepicker[0].offsetHeight>$(window).height()+$(window).scrollTop() )
|
||||
top = offset.top-datetimepicker[0].offsetHeight+1;
|
||||
if (top < 0)
|
||||
top = 0;
|
||||
if( left+datetimepicker[0].offsetWidth>$(window).width() )
|
||||
left = offset.left-datetimepicker[0].offsetWidth+datetimepicker.data('input')[0].offsetWidth;
|
||||
datetimepicker.css({
|
||||
|
Loading…
Reference in New Issue
Block a user