File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ test( "closeOnEscape", function() {
206
206
} ) ;
207
207
208
208
test ( "closeText" , function ( ) {
209
- expect ( 3 ) ;
209
+ expect ( 4 ) ;
210
210
211
211
var element = $ ( "<div></div>" ) . dialog ( ) ;
212
212
equal ( $ . trim ( element . dialog ( "widget" ) . find ( ".ui-dialog-titlebar-close" ) . text ( ) ) , "Close" ,
@@ -222,6 +222,11 @@ test( "closeText", function() {
222
222
equal ( $ . trim ( element . dialog ( "widget" ) . find ( ".ui-dialog-titlebar-close" ) . text ( ) ) , "bar" ,
223
223
"closeText via option method" ) ;
224
224
element . remove ( ) ;
225
+
226
+ element = $ ( "<div></div>" ) . dialog ( { closeText : "<span>foo</span>" } ) ;
227
+ equal ( $ . trim ( element . dialog ( "widget" ) . find ( ".ui-dialog-titlebar-close" ) . text ( ) ) , "<span>foo</span>" ,
228
+ "closeText is escaped" ) ;
229
+ element . remove ( ) ;
225
230
} ) ;
226
231
227
232
test ( "draggable" , function ( ) {
Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ $.widget( "ui.dialog", {
426
426
// dialog in IE (#9312)
427
427
this . uiDialogTitlebarClose = $ ( "<button type='button'></button>" )
428
428
. button ( {
429
- label : this . options . closeText ,
429
+ label : $ ( "<a>" ) . text ( this . options . closeText ) . html ( ) ,
430
430
icon : "ui-icon-closethick" ,
431
431
showLabel : false
432
432
} )
@@ -715,7 +715,7 @@ $.widget( "ui.dialog", {
715
715
this . uiDialogTitlebarClose . button ( {
716
716
717
717
// Ensure that we always pass a string
718
- label : "" + value
718
+ label : $ ( "<a>" ) . text ( "" + this . options . closeText ) . html ( )
719
719
} ) ;
720
720
}
721
721
You can’t perform that action at this time.
0 commit comments