File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ test( "closeOnEscape", function() {
206206} ) ;
207207
208208test ( "closeText" , function ( ) {
209- expect ( 3 ) ;
209+ expect ( 4 ) ;
210210
211211 var element = $ ( "<div></div>" ) . dialog ( ) ;
212212 equal ( $ . trim ( element . dialog ( "widget" ) . find ( ".ui-dialog-titlebar-close" ) . text ( ) ) , "Close" ,
@@ -222,6 +222,11 @@ test( "closeText", function() {
222222 equal ( $ . trim ( element . dialog ( "widget" ) . find ( ".ui-dialog-titlebar-close" ) . text ( ) ) , "bar" ,
223223 "closeText via option method" ) ;
224224 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 ( ) ;
225230} ) ;
226231
227232test ( "draggable" , function ( ) {
Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ $.widget( "ui.dialog", {
426426 // dialog in IE (#9312)
427427 this . uiDialogTitlebarClose = $ ( "<button type='button'></button>" )
428428 . button ( {
429- label : this . options . closeText ,
429+ label : $ ( "<a>" ) . text ( this . options . closeText ) . html ( ) ,
430430 icon : "ui-icon-closethick" ,
431431 showLabel : false
432432 } )
@@ -715,7 +715,7 @@ $.widget( "ui.dialog", {
715715 this . uiDialogTitlebarClose . button ( {
716716
717717 // Ensure that we always pass a string
718- label : "" + value
718+ label : $ ( "<a>" ) . text ( "" + this . options . closeText ) . html ( )
719719 } ) ;
720720 }
721721
You can’t perform that action at this time.
0 commit comments