Skip to content

Commit 140fa73

Browse files
committed
use and accept integer values only for html element
1 parent 478e434 commit 140fa73

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ui/widgets/dialog.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $.widget( "ui.dialog", {
8181
resizable: true,
8282
show: null,
8383
title: null,
84-
uiDialogTitleTagName: "<span>",
84+
uiDialogTitleHeadingLevel: 0,
8585
width: 300,
8686

8787
// Callbacks
@@ -438,8 +438,12 @@ $.widget( "ui.dialog", {
438438
}
439439
} );
440440

441-
uiDialogTitle = $( this.options.uiDialogTitleTagName )
442-
.uniqueId().prependTo( this.uiDialogTitlebar );
441+
var uiDialogHeadingLevel = Number.isInteger( this.options.uiDialogTitleHeadingLevel )
442+
&& this.options.uiDialogTitleHeadingLevel > 0
443+
&& this.options.uiDialogTitleHeadingLevel <= 6
444+
? "h" + this.options.uiDialogTitleHeadingLevel : "span";
445+
446+
uiDialogTitle = $( "<" + uiDialogHeadingLevel + ">" ).uniqueId().prependTo( this.uiDialogTitlebar );
443447
this._addClass( uiDialogTitle, "ui-dialog-title" );
444448
this._title( uiDialogTitle );
445449

0 commit comments

Comments
 (0)