Skip to content

Commit 10fa7f9

Browse files
Andrew Powellscottgonzalez
Andrew Powell
authored andcommitted
Datepicker: removed conditional mozilla browser check block. Fixes #7322 - Year selector disappears after setting an option in Firefox
(cherry picked from commit a6227be)
1 parent 804ba0a commit 10fa7f9

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

ui/jquery.ui.datepicker.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ $.extend(Datepicker.prototype, {
705705
var origyearshtml = inst.yearshtml;
706706
setTimeout(function(){
707707
//assure that inst.yearshtml didn't change.
708-
if( origyearshtml === inst.yearshtml ){
708+
if( origyearshtml === inst.yearshtml && inst.yearshtml ){
709709
inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);
710710
}
711711
origyearshtml = inst.yearshtml = null;
@@ -1602,14 +1602,9 @@ $.extend(Datepicker.prototype, {
16021602
'>' + year + '</option>';
16031603
}
16041604
inst.yearshtml += '</select>';
1605-
//when showing there is no need for later update
1606-
if( ! $.browser.mozilla ){
1607-
html += inst.yearshtml;
1608-
inst.yearshtml = null;
1609-
} else {
1610-
// will be replaced later with inst.yearshtml
1611-
html += '<select class="ui-datepicker-year"><option value="' + drawYear + '" selected="selected">' + drawYear + '</option></select>';
1612-
}
1605+
1606+
html += inst.yearshtml;
1607+
inst.yearshtml = null;
16131608
}
16141609
}
16151610
html += this._get(inst, 'yearSuffix');

0 commit comments

Comments
 (0)