]> source.dussan.org Git - jquery-ui.git/commitdiff
core: Added $.widget.defaults.
authorScott González <scott.gonzalez@gmail.com>
Wed, 11 Jun 2008 01:28:28 +0000 (01:28 +0000)
committerScott González <scott.gonzalez@gmail.com>
Wed, 11 Jun 2008 01:28:28 +0000 (01:28 +0000)
ui/ui.core.js

index 041291f9c14d192d8785dbaff1eec725edc18aca..eaffb20ca5b1ffa4eab6af447f1cd77968bfce04 100644 (file)
@@ -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