Skip to content

Commit 56e8aad

Browse files
author
Ca-Phun Ung
committed
Datepicker - fixes #3695 [multi-datepicker layout issue in IE]: IE doesn't seem to like dynamic widths so had no other choice but to hard code some width values (this needs a better fix).
1 parent b2c2240 commit 56e8aad

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

themes/base/ui.datepicker.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,17 @@
4444
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
4545
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
4646
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
47-
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
47+
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
48+
49+
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
50+
.ui-datepicker-cover {
51+
display: none; /*sorry for IE5*/
52+
display/**/: block; /*sorry for IE5*/
53+
position: absolute; /*must have*/
54+
z-index: -1; /*must have*/
55+
filter: mask(); /*must have*/
56+
top: -4px; /*must have*/
57+
left: -4px; /*must have*/
58+
width: 200px; /*must have*/
59+
height: 200px; /*must have*/
60+
}

ui/ui.datepicker.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,24 @@ $.extend(Datepicker.prototype, {
595595
.trigger('mouseover')
596596
.end();
597597
var numMonths = this._getNumberOfMonths(inst);
598+
var months = this._get(inst, 'numberOfMonths');
599+
var multi = '';
600+
if (months > 1) {
601+
if (months % 4 == 0) {
602+
multi = 'ui-datepicker-multi-4';
603+
inst.dpDiv.css('width','60em');
604+
} else if (months % 3 == 0) {
605+
multi = 'ui-datepicker-multi-3';
606+
inst.dpDiv.css('width','51em');
607+
} else if (months % 2 == 0) {
608+
multi = 'ui-datepicker-multi-2';
609+
inst.dpDiv.css('width','34em');
610+
}
611+
inst.dpDiv.addClass(multi);
612+
} else {
613+
inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4');
614+
inst.dpDiv.width('');
615+
}
598616
inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
599617
'Class']('ui-datepicker-multi');
600618
inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +

0 commit comments

Comments
 (0)