Skip to content

Commit 821ecf3

Browse files
committed
Dialog: Implement new _addClass api
1 parent 8f54ec0 commit 821ecf3

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

ui/dialog.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ $.widget( "ui.dialog", {
128128
.removeAttr( "title" )
129129
.appendTo( this.uiDialog );
130130

131-
this._addClass( "ui-dialog-content", "ui-widget-content" );
131+
this._addClass( "ui-dialog-content ui-widget-content" );
132132

133133
this._createTitlebar();
134134
this._createButtonPane();
@@ -171,8 +171,6 @@ $.widget( "ui.dialog", {
171171
// Without detaching first, the following becomes really slow
172172
.detach();
173173

174-
this._removeClass( "ui-dialog-content", "ui-widget-content" );
175-
176174
this.uiDialog.stop( true, true ).remove();
177175

178176
if ( this.originalTitle ) {
@@ -349,7 +347,7 @@ $.widget( "ui.dialog", {
349347
})
350348
.appendTo( this._appendTo() );
351349

352-
this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" );
350+
this._addClass( this.uiDialog, "ui-dialog ui-widget ui-widget-content ui-front" );
353351

354352
this._on( this.uiDialog, {
355353
keydown: function( event ) {
@@ -398,9 +396,11 @@ $.widget( "ui.dialog", {
398396
},
399397

400398
_createTitlebar: function() {
401-
this.uiDialogTitlebar = $( "<div>" )
402-
.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
403-
.prependTo( this.uiDialog );
399+
this.uiDialogTitlebar = $( "<div>" ).prependTo( this.uiDialog );
400+
401+
this._addClass( this.uiDialogTitlebar,
402+
"ui-dialog-titlebar ui-widget-header ui-helper-clearfix" );
403+
404404
this._on( this.uiDialogTitlebar, {
405405
mousedown: function( event ) {
406406
// Don't prevent click on close button (#8838)
@@ -455,8 +455,7 @@ $.widget( "ui.dialog", {
455455

456456
_createButtonPane: function() {
457457
this.uiDialogButtonPane = $( "<div>" );
458-
this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane",
459-
"ui-widget-content ui-helper-clearfix" );
458+
this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" );
460459

461460
this.uiButtonSet = $( "<div>" )
462461
.appendTo( this.uiDialogButtonPane );
@@ -853,7 +852,7 @@ $.widget( "ui.dialog", {
853852
this.overlay = $( "<div>" )
854853
.appendTo( this._appendTo() );
855854

856-
this._addClass( this.overlay, "ui-widget-overlay", "ui-front" );
855+
this._addClass( this.overlay, "ui-widget-overlay ui-front" );
857856
this._on( this.overlay, {
858857
mousedown: "_keepFocus"
859858
});

0 commit comments

Comments
 (0)