From: Ca-Phun Ung Date: Tue, 9 Feb 2010 04:09:26 +0000 (+0000) Subject: datepicker: fixes #4443: Datepicker's vertical position in thickbox. This also fixes... X-Git-Tag: 1.8rc2~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5eeaa658ba1a37d3ced10a5435a0b302a922c199;p=jquery-ui.git datepicker: fixes #4443: Datepicker's vertical position in thickbox. This also fixes the virtual position when the datepicker is close but not right at the bottom of the page. --- diff --git a/tests/visual/datepicker/datepicker_ticket_4443.html b/tests/visual/datepicker/datepicker_ticket_4443.html new file mode 100644 index 000000000..84f08b99b --- /dev/null +++ b/tests/visual/datepicker/datepicker_ticket_4443.html @@ -0,0 +1,37 @@ + + + + Datepicker Visual Test : Datepicker ticket #4443 + + + + + + + + + + + + + +

#4443 - Datepicker's vertical position in thickbox is wrong

+ +

+ + + + + diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 91f863ef9..03d58681a 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -725,7 +725,7 @@ $.extend(Datepicker.prototype, { offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0); offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? - Math.abs(offset.top + dpHeight + inputHeight * 2 - viewHeight) : 0); + Math.abs(dpHeight + inputHeight) : 0); return offset; },