Skip to content
Permalink
Browse files

Datepicker - fixes #3695 [multi-datepicker layout issue in IE]: IE do…

…esn't seem to like dynamic widths so had no other choice but to hard code some width values (this needs a better fix).
  • Loading branch information
Ca-Phun Ung
Ca-Phun Ung committed Dec 23, 2008
1 parent b2c2240 commit 56e8aad838e9609730d087ce44c37e2388b54e59
Showing with 32 additions and 1 deletion.
  1. +14 −1 themes/base/ui.datepicker.css
  2. +18 −0 ui/ui.datepicker.js
@@ -44,4 +44,17 @@
.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
.ui-datepicker-rtl .ui-datepicker-group { float:right; }
.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }

/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
.ui-datepicker-cover {
display: none; /*sorry for IE5*/
display/**/: block; /*sorry for IE5*/
position: absolute; /*must have*/
z-index: -1; /*must have*/
filter: mask(); /*must have*/
top: -4px; /*must have*/
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}
@@ -595,6 +595,24 @@ $.extend(Datepicker.prototype, {
.trigger('mouseover')
.end();
var numMonths = this._getNumberOfMonths(inst);
var months = this._get(inst, 'numberOfMonths');
var multi = '';
if (months > 1) {
if (months % 4 == 0) {
multi = 'ui-datepicker-multi-4';
inst.dpDiv.css('width','60em');
} else if (months % 3 == 0) {
multi = 'ui-datepicker-multi-3';
inst.dpDiv.css('width','51em');
} else if (months % 2 == 0) {
multi = 'ui-datepicker-multi-2';
inst.dpDiv.css('width','34em');
}
inst.dpDiv.addClass(multi);
} else {
inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4');
inst.dpDiv.width('');
}
inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
'Class']('ui-datepicker-multi');
inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +

0 comments on commit 56e8aad

Please sign in to comment.
You can’t perform that action at this time.