aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2008-06-11 01:28:28 +0000
committerScott González <scott.gonzalez@gmail.com>2008-06-11 01:28:28 +0000
commiteecfadd25a2c0b1204fd9838982f7d7b2df4a71e (patch)
treef44b2a6c14003f31c67537c92c3a08d5631b3601 /ui
parent21daf50102d8e71cc49910b3610530ac986ca8e8 (diff)
downloadjquery-ui-eecfadd25a2c0b1204fd9838982f7d7b2df4a71e.tar.gz
jquery-ui-eecfadd25a2c0b1204fd9838982f7d7b2df4a71e.zip
core: Added $.widget.defaults.
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.core.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 041291f9c..eaffb20ca 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -6,7 +6,6 @@
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
- *
*/
;(function($) {
@@ -115,7 +114,7 @@ $.widget = function(name, prototype) {
this.widgetName = name;
this.widgetBaseClass = namespace + '-' + name;
- this.options = $.extend({ disabled: false }, $[namespace][name].defaults, options);
+ this.options = $.extend({}, $.widget.defaults, $[namespace][name].defaults, options);
this.element = $(element)
.bind('setData.' + name, function(e, key, value) {
return self.setData(key, value);
@@ -159,6 +158,10 @@ $.widget.prototype = {
}
};
+$.widget.defaults = {
+ disabled: false
+};
+
/** Mouse Interaction Plugin **/
@@ -211,7 +214,10 @@ $.ui.mouse = {
if (this.mouseDistanceMet(e) && this.mouseDelayMet(e)) {
this._mouseStarted = (this.mouseStart(e) !== false);
- if (!this._mouseStarted) { e.preventDefault(); return true; }
+ if (!this._mouseStarted) {
+ e.preventDefault();
+ return true;
+ }
}
// these delegates are required to keep context