r2033 - trunk/ui

r2033 - trunk/ui


Author: scott.gonzalez
Date: Sat Feb 7 06:28:14 2009
New Revision: 2033
Modified:
trunk/ui/ui.dialog.js
Log:
Dialog: Fixed #4086: Allow changing the dialogClass option after init.
Modified: trunk/ui/ui.dialog.js
==============================================================================
--- trunk/ui/ui.dialog.js    (original)
+++ trunk/ui/ui.dialog.js    Sat Feb 7 06:28:14 2009
@@ -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 @@
            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',
@@ -401,6 +401,11 @@
                break;
            case "closeText":
                this.uiDialogTitlebarCloseText.text(value);
+                break;
+            case "dialogClass":
+                this.uiDialog
+                    .removeClass(this.options.dialogClass)
+                    .addClass(uiDialogClasses + value);
                break;
            case "draggable":
                (value