Datepicker: removed conditional mozilla browser check block. Fixes #7322 - Year selector disappears after setting an option in Firefox

(cherry picked from commit a6227be2c0)
This commit is contained in:
Andrew Powell 2011-05-12 11:28:37 -04:00 committed by Scott González
parent 804ba0a2df
commit 10fa7f9ae9

View File

@ -705,7 +705,7 @@ $.extend(Datepicker.prototype, {
var origyearshtml = inst.yearshtml; var origyearshtml = inst.yearshtml;
setTimeout(function(){ setTimeout(function(){
//assure that inst.yearshtml didn't change. //assure that inst.yearshtml didn't change.
if( origyearshtml === inst.yearshtml ){ if( origyearshtml === inst.yearshtml && inst.yearshtml ){
inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml); inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);
} }
origyearshtml = inst.yearshtml = null; origyearshtml = inst.yearshtml = null;
@ -1602,14 +1602,9 @@ $.extend(Datepicker.prototype, {
'>' + year + '</option>'; '>' + year + '</option>';
} }
inst.yearshtml += '</select>'; inst.yearshtml += '</select>';
//when showing there is no need for later update
if( ! $.browser.mozilla ){ html += inst.yearshtml;
html += inst.yearshtml; inst.yearshtml = null;
inst.yearshtml = null;
} else {
// will be replaced later with inst.yearshtml
html += '<select class="ui-datepicker-year"><option value="' + drawYear + '" selected="selected">' + drawYear + '</option></select>';
}
} }
} }
html += this._get(inst, 'yearSuffix'); html += this._get(inst, 'yearSuffix');