]> source.dussan.org Git - jquery-ui.git/commitdiff
Datepicker: Fixed position problem when input is in a fixed element. Fixes #5626...
authorLuis Dalmolin <luis.nh@gmail.com>
Mon, 16 Jul 2012 12:54:48 +0000 (09:54 -0300)
committerScott González <scott.gonzalez@gmail.com>
Tue, 17 Jul 2012 20:23:13 +0000 (16:23 -0400)
(cherry picked from commit 147ec7bd624e631fe019973876ad587e85d112bf)

ui/jquery.ui.datepicker.js

index 51d1b183b69310339862755d51e6f1aa8c7af213..1c94d61fd0f94658afdd7ba0a150afbc2666a0e5 100644 (file)
@@ -765,8 +765,8 @@ $.extend(Datepicker.prototype, {
                var dpHeight = inst.dpDiv.outerHeight();
                var inputWidth = inst.input ? inst.input.outerWidth() : 0;
                var inputHeight = inst.input ? inst.input.outerHeight() : 0;
-               var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
-               var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
+               var viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft());
+               var viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
 
                offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
                offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;