diff options
author | gnarf <gnarf@gnarf.net> | 2011-05-10 16:16:34 -0500 |
---|---|---|
committer | gnarf <gnarf@gnarf.net> | 2011-05-10 16:16:34 -0500 |
commit | 27a7deebf299e1673e8b452476be02e486bba2c6 (patch) | |
tree | 79521a78ab770ebd7ee167575b680f14d3ed4089 /ui/jquery.ui.datepicker.js | |
parent | 4dcfeee8d54d81db4d5af8b2fd189b799cd9561e (diff) | |
parent | 85ac420a1e4281ee7f361e847d3cad72fa58525e (diff) | |
download | jquery-ui-27a7deebf299e1673e8b452476be02e486bba2c6.tar.gz jquery-ui-27a7deebf299e1673e8b452476be02e486bba2c6.zip |
Merge branch 'master' into effects-unit
Conflicts:
ui/jquery.effects.pulsate.js
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r-- | ui/jquery.ui.datepicker.js | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 3437d0bda..12323672a 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -648,7 +648,6 @@ $.extend(Datepicker.prototype, { var showAnim = $.datepicker._get(inst, 'showAnim'); var duration = $.datepicker._get(inst, 'duration'); var postProcess = function() { - $.datepicker._datepickerShowing = true; var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only if( !! cover.length ){ var borders = $.datepicker._getBorders(inst.dpDiv); @@ -657,6 +656,7 @@ $.extend(Datepicker.prototype, { } }; inst.dpDiv.zIndex($(input).zIndex()+1); + $.datepicker._datepickerShowing = true; // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) @@ -685,10 +685,9 @@ $.extend(Datepicker.prototype, { var numMonths = this._getNumberOfMonths(inst); var cols = numMonths[1]; var width = 17; + inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width(''); 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').width(''); inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') + 'Class']('ui-datepicker-multi'); inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + @@ -996,14 +995,24 @@ $.extend(Datepicker.prototype, { }; // Extract a name from the string value and convert to an index var getName = function(match, shortNames, longNames) { - var names = (lookAhead(match) ? longNames : shortNames); - for (var i = 0; i < names.length; i++) { - if (value.substr(iValue, names[i].length).toLowerCase() == names[i].toLowerCase()) { - iValue += names[i].length; - return i + 1; + var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { + return [ [k, v] ]; + }).sort(function (a, b) { + return -(a[1].length - b[1].length); + }); + var index = -1; + $.each(names, function (i, pair) { + var name = pair[1]; + if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) { + index = pair[0]; + iValue += name.length; + return false; } - } - throw 'Unknown name at position ' + iValue; + }); + if (index != -1) + return index + 1; + else + throw 'Unknown name at position ' + iValue; }; // Confirm that a literal character matches the string value var checkLiteral = function() { |