Skip to content

Commit 463654d

Browse files
committed
fixup! Datepicker: Make sure text option are text, shorten HTML strings
1 parent 7cd8b25 commit 463654d

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

ui/widgets/datepicker.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ $.extend( Datepicker.prototype, {
240240
inst.append.remove();
241241
}
242242
if ( appendText ) {
243-
inst.append = $( "<span></span>" )
244-
.attr( "class", this._appendClass )
243+
inst.append = $( "<span>" )
244+
.addClass( this._appendClass )
245245
.text( appendText );
246246
input[ isRTL ? "before" : "after" ]( inst.append );
247247
}
@@ -261,19 +261,19 @@ $.extend( Datepicker.prototype, {
261261
buttonImage = this._get( inst, "buttonImage" );
262262

263263
if ( this._get( inst, "buttonImageOnly" ) ) {
264-
inst.trigger = $( "<img/>" )
264+
inst.trigger = $( "<img>" )
265265
.addClass( this._triggerClass )
266266
.attr( {
267267
src: buttonImage,
268268
alt: buttonText,
269269
title: buttonText
270270
} );
271271
} else {
272-
inst.trigger = $( "<button type='button'></button>" )
272+
inst.trigger = $( "<button type='button'>" )
273273
.addClass( this._triggerClass );
274274
if ( buttonImage ) {
275275
inst.trigger.html(
276-
$( "<img/>" )
276+
$( "<img>" )
277277
.attr( {
278278
src: buttonImage,
279279
alt: buttonText,
@@ -1726,7 +1726,7 @@ $.extend( Datepicker.prototype, {
17261726
this._getFormatConfig( inst ) ) );
17271727

17281728
if ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ) {
1729-
prev = $( "<a></a>" )
1729+
prev = $( "<a>" )
17301730
.attr( {
17311731
"class": "ui-datepicker-prev ui-corner-all",
17321732
"data-handler": "prev",
@@ -1735,21 +1735,21 @@ $.extend( Datepicker.prototype, {
17351735
} )
17361736
.append(
17371737
$( "<span>" )
1738-
.attr( "class", "ui-icon ui-icon-circle-triangle-" +
1738+
.addClass( "ui-icon ui-icon-circle-triangle-" +
17391739
( isRTL ? "e" : "w" ) )
17401740
.text( prevText )
17411741
)[ 0 ].outerHTML;
17421742
} else if ( hideIfNoPrevNext ) {
17431743
prev = "";
17441744
} else {
1745-
prev = $( "<a></a>" )
1745+
prev = $( "<a>" )
17461746
.attr( {
17471747
"class": "ui-datepicker-prev ui-corner-all ui-state-disabled",
17481748
title: prevText
17491749
} )
17501750
.append(
17511751
$( "<span>" )
1752-
.attr( "class", "ui-icon ui-icon-circle-triangle-" +
1752+
.addClass( "ui-icon ui-icon-circle-triangle-" +
17531753
( isRTL ? "e" : "w" ) )
17541754
.text( prevText )
17551755
)[ 0 ].outerHTML;
@@ -1761,7 +1761,7 @@ $.extend( Datepicker.prototype, {
17611761
this._getFormatConfig( inst ) ) );
17621762

17631763
if ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ) {
1764-
next = $( "<a></a>" )
1764+
next = $( "<a>" )
17651765
.attr( {
17661766
"class": "ui-datepicker-next ui-corner-all",
17671767
"data-handler": "next",
@@ -1770,14 +1770,14 @@ $.extend( Datepicker.prototype, {
17701770
} )
17711771
.append(
17721772
$( "<span>" )
1773-
.attr( "class", "ui-icon ui-icon-circle-triangle-" +
1773+
.addClass( "ui-icon ui-icon-circle-triangle-" +
17741774
( isRTL ? "w" : "e" ) )
17751775
.text( nextText )
17761776
)[ 0 ].outerHTML;
17771777
} else if ( hideIfNoPrevNext ) {
17781778
next = "";
17791779
} else {
1780-
next = $( "<a></a>" )
1780+
next = $( "<a>" )
17811781
.attr( {
17821782
"class": "ui-datepicker-next ui-corner-all ui-state-disabled",
17831783
title: nextText
@@ -1797,7 +1797,7 @@ $.extend( Datepicker.prototype, {
17971797

17981798
controls = "";
17991799
if ( !inst.inline ) {
1800-
controls = $( "<button></button>" )
1800+
controls = $( "<button>" )
18011801
.attr( {
18021802
type: "button",
18031803
"class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all",
@@ -1812,7 +1812,7 @@ $.extend( Datepicker.prototype, {
18121812
buttonPanel = $( "<div class='ui-datepicker-buttonpane ui-widget-content'>" )
18131813
.append( isRTL ? controls : "" )
18141814
.append( this._isInRange( inst, gotoDate ) ?
1815-
$( "<button></button>" )
1815+
$( "<button>" )
18161816
.attr( {
18171817
type: "button",
18181818
"class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all",

0 commit comments

Comments
 (0)