Skip to content

Commit

Permalink
Datepicker: removed conditional mozilla browser check block. Fixes #7…
Browse files Browse the repository at this point in the history
…322 - Year selector disappears after setting an option in Firefox

(cherry picked from commit a6227be)
  • Loading branch information
Andrew Powell authored and scottgonzalez committed May 12, 2011
1 parent 804ba0a commit 10fa7f9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ui/jquery.ui.datepicker.js
Expand Up @@ -705,7 +705,7 @@ $.extend(Datepicker.prototype, {
var origyearshtml = inst.yearshtml;
setTimeout(function(){
//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);
}
origyearshtml = inst.yearshtml = null;
Expand Down Expand Up @@ -1602,14 +1602,9 @@ $.extend(Datepicker.prototype, {
'>' + year + '</option>';
}
inst.yearshtml += '</select>';
//when showing there is no need for later update
if( ! $.browser.mozilla ){
html += inst.yearshtml;
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 += inst.yearshtml;
inst.yearshtml = null;
}
}
html += this._get(inst, 'yearSuffix');
Expand Down

0 comments on commit 10fa7f9

Please sign in to comment.