});
test("dialogClass", function() {
- expect(4);
+ expect( 6 );
var el = $('<div></div>').dialog();
equal(el.dialog('widget').is(".foo"), false, 'dialogClass not specified. foo class added');
el = $('<div></div>').dialog({ dialogClass: "foo" });
equal(el.dialog('widget').is(".foo"), true, 'dialogClass in init. foo class added');
+ el.dialog( "option", "dialogClass", "foobar" );
+ equal( el.dialog('widget').is(".foo"), false, "dialogClass changed, previous one was removed" );
+ equal( el.dialog('widget').is(".foobar"), true, "dialogClass changed, new one was added" );
el.remove();
el = $('<div></div>').dialog({ dialogClass: "foo bar" });
var isDraggable, isResizable,
uiDialog = this.uiDialog;
+ if ( key === "dialogClass" ) {
+ uiDialog
+ .removeClass( this.options.dialogClass )
+ .addClass( value );
+ }
+
+ this._super( key, value );
+
switch ( key ) {
case "buttons":
this._createButtons( value );
label: "" + value
});
break;
- case "dialogClass":
- uiDialog
- .removeClass( this.options.dialogClass )
- .addClass( value );
- break;
case "disabled":
// TODO use toggleClass( "ui-dialog-disabled", value )
if ( value ) {
.html( "" + ( value || " " ) );
break;
}
-
- this._super( key, value );
},
_size: function() {