diff options
author | Ca-Phun Ung <pazu2k@gmail.com> | 2008-12-24 10:06:00 +0000 |
---|---|---|
committer | Ca-Phun Ung <pazu2k@gmail.com> | 2008-12-24 10:06:00 +0000 |
commit | d1620877db4ce4ecc3385dc6a628e13942f83ca9 (patch) | |
tree | de70d0dda452ce4a68df050d2bde1bd00b80453b | |
parent | 56e8aad838e9609730d087ce44c37e2388b54e59 (diff) | |
download | jquery-ui-d1620877db4ce4ecc3385dc6a628e13942f83ca9.tar.gz jquery-ui-d1620877db4ce4ecc3385dc6a628e13942f83ca9.zip |
Datepicker - fixes #3695 [multi-datepicker layout issue in IE]: added a better fix - needs refactoring.
-rw-r--r-- | ui/ui.datepicker.js | 25 |
1 files 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 += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' + - (/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 '</div><table class="ui-datepicker-calendar"><thead>' + |