diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-02-07 14:28:14 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-02-07 14:28:14 +0000 |
commit | 86a26f17ffea542ae9a67f7153484797b66ee8ca (patch) | |
tree | e4c77fd26108b7470b819b5144b61da8574c88d0 /ui | |
parent | fb7f7fc393c2544f87395200578bee7895d49c71 (diff) | |
download | jquery-ui-86a26f17ffea542ae9a67f7153484797b66ee8ca.tar.gz jquery-ui-86a26f17ffea542ae9a67f7153484797b66ee8ca.zip |
Dialog: Fixed #4086: Allow changing the dialogClass option after init.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.dialog.js | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/ui/ui.dialog.js b/ui/ui.dialog.js index 1edfee15d..52a9d21a6 100644 --- a/ui/ui.dialog.js +++ b/ui/ui.dialog.js @@ -15,17 +15,23 @@ (function($) { var setDataSwitch = { - dragStart: "start.draggable", - drag: "drag.draggable", - dragStop: "stop.draggable", - maxHeight: "maxHeight.resizable", - minHeight: "minHeight.resizable", - maxWidth: "maxWidth.resizable", - minWidth: "minWidth.resizable", - resizeStart: "start.resizable", - resize: "drag.resizable", - resizeStop: "stop.resizable" -}; + dragStart: "start.draggable", + drag: "drag.draggable", + dragStop: "stop.draggable", + maxHeight: "maxHeight.resizable", + minHeight: "minHeight.resizable", + maxWidth: "maxWidth.resizable", + minWidth: "minWidth.resizable", + resizeStart: "start.resizable", + resize: "drag.resizable", + resizeStop: "stop.resizable" + }, + + uiDialogClasses = + 'ui-dialog ' + + 'ui-widget ' + + 'ui-widget-content ' + + 'ui-corner-all '; $.widget("ui.dialog", { @@ -41,13 +47,7 @@ $.widget("ui.dialog", { uiDialog = (this.uiDialog = $('<div/>')) .appendTo(document.body) .hide() - .addClass( - 'ui-dialog ' + - 'ui-widget ' + - 'ui-widget-content ' + - 'ui-corner-all ' + - options.dialogClass - ) + .addClass(uiDialogClasses + options.dialogClass) .css({ position: 'absolute', overflow: 'hidden', @@ -402,6 +402,11 @@ $.widget("ui.dialog", { case "closeText": this.uiDialogTitlebarCloseText.text(value); break; + case "dialogClass": + this.uiDialog + .removeClass(this.options.dialogClass) + .addClass(uiDialogClasses + value); + break; case "draggable": (value ? this._makeDraggable() |