r3548 committed - Dialog: Removed use of .data() for proxying resizable options.
Revision: 3548
Author: scott.gonzalez
Date: Mon Dec 28 19:49:33 2009
Log: Dialog: Removed use of .data() for proxying resizable options.
http://code.google.com/p/jquery-ui/source/detail?r=3548
Modified:
/branches/dev/ui/jquery.ui.dialog.js
=======================================
--- /branches/dev/ui/jquery.ui.dialog.js Tue Dec 22 20:30:15 2009
+++ /branches/dev/ui/jquery.ui.dialog.js Mon Dec 28 19:49:33 2009
@@ -18,17 +18,11 @@
*/
(function($) {
-var setOptionSwitch = {
- maxHeight: "maxHeight.resizable",
- maxWidth: "maxWidth.resizable",
- minWidth: "minWidth.resizable"
- },
-
- uiDialogClasses =
- 'ui-dialog ' +
- 'ui-widget ' +
- 'ui-widget-content ' +
- 'ui-corner-all ';
+var uiDialogClasses =
+ 'ui-dialog ' +
+ 'ui-widget ' +
+ 'ui-widget-content ' +
+ 'ui-corner-all ';
$.widget("ui.dialog", {
options: {
@@ -439,9 +433,9 @@
_setOption: function(key, value){
var self = this,
uiDialog = self.uiDialog,
+ isResizable = uiDialog.is(':data(resizable)'),
resize = false;
- (setOptionSwitch[key] && uiDialog.data(setOptionSwitch[key], value));
switch (key) {
case "buttons":
self._createButtons(value);
@@ -468,7 +462,20 @@
case "height":
resize = true;
break;
+ case "maxHeight":
+ (isResizable && uiDialog.resizable('option', 'maxHeight', value));
+ resize = true;
+ break;
+ case "maxWidth":
+ (isResizable && uiDialog.resizable('option', 'maxWidth', value));
+ resize = true;
+ break;
case "minHeight":
+ (isResizable && uiDialog.resizable('option', 'minHeight', value));
+ resize = true;
+ break;
+ case "minWidth":
+ (isResizable && uiDialog.resizable('option', 'minWidth', value));
resize = true;
break;
case "position":
--