From 86a26f17ffea542ae9a67f7153484797b66ee8ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Sat, 7 Feb 2009 14:28:14 +0000 Subject: [PATCH] Dialog: Fixed #4086: Allow changing the dialogClass option after init. --- ui/ui.dialog.js | 41 +++++++++++++++++++++++------------------ 1 file 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 = $('
')) .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() -- 2.39.5