From d1620877db4ce4ecc3385dc6a628e13942f83ca9 Mon Sep 17 00:00:00 2001 From: Ca-Phun Ung Date: Wed, 24 Dec 2008 10:06:00 +0000 Subject: Datepicker - fixes #3695 [multi-datepicker layout issue in IE]: added a better fix - needs refactoring. --- ui/ui.datepicker.js | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index 391b45087..47085197d 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -595,23 +595,12 @@ $.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); + var cols = numMonths[1]; + var width = 17; + if (cols > 1) { + inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em'); } else { - inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4'); - inst.dpDiv.width(''); + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); } inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + 'Class']('ui-datepicker-multi'); @@ -1352,8 +1341,8 @@ $.extend(Datepicker.prototype, { calender += '">'; } calender += '
' + - (/all|left/.test(cornerClass) ? (isRTL ? next : prev) : '') + - (/all|right/.test(cornerClass) ? (isRTL ? prev : next) : '') + + (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') + + (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, selectedDate, row > 0 || col > 0, monthNames) + // draw month headers '
' + -- cgit v1.2.3