aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2009-04-10 07:57:26 +0000
committerKeith Wood <kbwood.au@gmail.com>2009-04-10 07:57:26 +0000
commit1f2dcf8af9740ae5f65e4f4623bd6f0fafd3ba58 (patch)
treef8c01e511e797aa2e860a1fb7a0a027e06ec61fb
parent5235b3bbd51dbc139ad8405eb76aa5e8609fd34e (diff)
downloadjquery-ui-1f2dcf8af9740ae5f65e4f4623bd6f0fafd3ba58.tar.gz
jquery-ui-1f2dcf8af9740ae5f65e4f4623bd6f0fafd3ba58.zip
Datepicker: Fixed #4054 - Datepicker overlay problem in IE6
-rw-r--r--ui/ui.datepicker.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js
index 1de6d45b7..3a13c9425 100644
--- a/ui/ui.datepicker.js
+++ b/ui/ui.datepicker.js
@@ -550,9 +550,10 @@ $.extend(Datepicker.prototype, {
var duration = $.datepicker._get(inst, 'duration');
var postProcess = function() {
$.datepicker._datepickerShowing = true;
- if ($.browser.msie && parseInt($.browser.version,10) < 7) // fix IE < 7 select problems
- $('iframe.ui-datepicker-cover').css({width: inst.dpDiv.width() + 4,
- height: inst.dpDiv.height() + 4});
+ var borders = $.datepicker._getBorders(inst.dpDiv);
+ inst.dpDiv.find('iframe.ui-datepicker-cover'). // IE6- only
+ css({left: -borders[0], top: -borders[1],
+ width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});
};
if ($.effects && $.effects[showAnim])
inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
@@ -568,12 +569,12 @@ $.extend(Datepicker.prototype, {
/* Generate the date picker content. */
_updateDatepicker: function(inst) {
- var dims = {width: inst.dpDiv.width() + 4,
- height: inst.dpDiv.height() + 4};
var self = this;
+ var borders = $.datepicker._getBorders(inst.dpDiv);
inst.dpDiv.empty().append(this._generateHTML(inst))
- .find('iframe.ui-datepicker-cover').
- css({width: dims.width, height: dims.height})
+ .find('iframe.ui-datepicker-cover') // IE6- only
+ .css({left: -borders[0], top: -borders[1],
+ width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
.end()
.find('button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a')
.bind('mouseout', function(){
@@ -608,6 +609,17 @@ $.extend(Datepicker.prototype, {
$(inst.input[0]).focus();
},
+ /* Retrieve the size of left and top borders for an element.
+ @param elem (jQuery object) the element of interest
+ @return (number[2]) the left and top borders */
+ _getBorders: function(elem) {
+ var convert = function(value) {
+ return {thin: 1, medium: 2, thick: 3}[value] || value;
+ };
+ return [parseFloat(convert(elem.css('border-left-width'))),
+ parseFloat(convert(elem.css('border-top-width')))];
+ },
+
/* Check positioning to remain on screen. */
_checkOffset: function(inst, offset, isFixed) {
var dpWidth = inst.dpDiv.outerWidth();