" ) )
@@ -163,11 +133,6 @@ $.widget("ui.dialog", {
.addClass( "ui-dialog-buttonset" )
.appendTo( uiDialogButtonPane );
- // TODO move into _createWrapper
- this.uiDialog.attr({
- role: "dialog",
- "aria-labelledby": uiDialogTitle.attr( "id" )
- });
// TODO move into _createWrapper
// We assume that any existing aria-describedby attribute means
@@ -358,6 +323,48 @@ $.widget("ui.dialog", {
this._delay( checkFocus );
},
+ _createTitlebar: function() {
+ var uiDialogTitle;
+
+ this.uiDialogTitlebar = $( "
" )
+ .addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
+ .prependTo( this.uiDialog );
+ this._on( this.uiDialogTitlebar, {
+ mousedown: function() {
+ // TODO call _focusTabbable or _keepFocus
+ // Dialog isn't getting focus when dragging (#8063)
+ this.uiDialog.focus();
+ }
+ });
+
+ this.uiDialogTitlebarClose = $( "" )
+ .button({
+ label: this.options.closeText,
+ icons: {
+ primary: "ui-icon-closethick"
+ },
+ text: false
+ })
+ .addClass( "ui-dialog-titlebar-close" )
+ .appendTo( this.uiDialogTitlebar );
+ this._on( this.uiDialogTitlebarClose, {
+ "click": function( event ) {
+ event.preventDefault();
+ this.close( event );
+ }
+ });
+
+ uiDialogTitle = $( "" )
+ .uniqueId()
+ .addClass( "ui-dialog-title" )
+ .html( this.options.title || " " )
+ .prependTo( this.uiDialogTitlebar );
+
+ this.uiDialog.attr({
+ "aria-labelledby": uiDialogTitle.attr( "id" )
+ });
+ },
+
_createButtons: function() {
var that = this,
buttons = this.options.buttons;