r3513 committed - Update dialog for new widget factory.
Revision: 3513
Author: scott.gonzalez
Date: Tue Dec 22 19:52:29 2009
Log: Update dialog for new widget factory.
http://code.google.com/p/jquery-ui/source/detail?r=3513
Modified:
/branches/dev/ui/jquery.ui.dialog.js
=======================================
--- /branches/dev/ui/jquery.ui.dialog.js Tue Dec 22 13:11:49 2009
+++ /branches/dev/ui/jquery.ui.dialog.js Tue Dec 22 19:52:29 2009
@@ -18,7 +18,7 @@
*/
(function($) {
-var setDataSwitch = {
+var setOptionSwitch = {
maxHeight: "maxHeight.resizable",
maxWidth: "maxWidth.resizable",
minWidth: "minWidth.resizable"
@@ -31,7 +31,29 @@
'ui-corner-all ';
$.widget("ui.dialog", {
-
+ options: {
+ autoOpen: true,
+ stackfix: false,
+ buttons: {},
+ closeOnEscape: true,
+ closeText: 'close',
+ dialogClass: '',
+ draggable: true,
+ hide: null,
+ height: 'auto',
+ maxHeight: false,
+ maxWidth: false,
+ minHeight: 150,
+ minWidth: 150,
+ modal: false,
+ position: 'center',
+ resizable: true,
+ show: null,
+ stack: true,
+ title: '',
+ width: 300,
+ zIndex: 1000
+ },
_init: function() {
this.originalTitle = this.element.attr('title');
@@ -369,7 +391,7 @@
var myAt = [],
offset = [0, 0];
- position = position || $.ui.dialog.defaults.position;
+ position = position || $.ui.dialog.prototype.options.position;
// deep extending converts arrays to objects in jQuery <= 1.3.2 :-(
// if (typeof position == 'string' || $.isArray(position)) {
@@ -414,18 +436,18 @@
});
},
- _setData: function(key, value){
+ _setOption: function(key, value){
var self = this,
uiDialog = self.uiDialog,
resize = false;
- (setDataSwitch[key] && uiDialog.data(setDataSwitch[key], value));
+ (setOptionSwitch[key] && uiDialog.data(setOptionSwitch[key], value));
switch (key) {
case "buttons":
self._createButtons(value);
break;
case "closeText":
- // convert whatever was passed in o a string, for text() to not throw
up
+ // convert whatever was passed in to a string, for text() to not throw
up
self.uiDialogTitlebarCloseText.text("" + value);
break;
case "dialogClass":
@@ -474,7 +496,7 @@
break;
}
- $.widget.prototype._setData.apply(self, arguments);
+ $.widget.prototype._setOption.apply(self, arguments);
(resize && self._size());
},
@@ -515,29 +537,6 @@
$.extend($.ui.dialog, {
version: "@VERSION",
- defaults: {
- autoOpen: true,
- stackfix: false,
- buttons: {},
- closeOnEscape: true,
- closeText: 'close',
- dialogClass: '',
- draggable: true,
- hide: null,
- height: 'auto',
- maxHeight: false,
- maxWidth: false,
- minHeight: 150,
- minWidth: 150,
- modal: false,
- position: 'center',
- resizable: true,
- show: null,
- stack: true,
- title: '',
- width: 300,
- zIndex: 1000
- },
uuid: 0,
maxZ: 0,
--