Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 6fa8ecf

Browse files
committed
Widget Factory: update to lastest from ui
1 parent 17ae60a commit 6fa8ecf

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

js/jquery.ui.widget.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* jQuery UI Widget 1.10.1
2+
* jQuery UI Widget @VERSION
33
* http://jqueryui.com
44
*
55
* Copyright 2013 jQuery Foundation and other contributors
@@ -106,7 +106,7 @@ $.widget = function( name, base, prototype ) {
106106
// TODO: remove support for widgetEventPrefix
107107
// always use the name + a colon as the prefix, e.g., draggable:start
108108
// don't prefix for widgets that aren't DOM-based
109-
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
109+
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
110110
}, proxiedPrototype, {
111111
constructor: constructor,
112112
namespace: namespace,
@@ -134,7 +134,7 @@ $.widget = function( name, base, prototype ) {
134134
}
135135

136136
$.widget.bridge( name, constructor );
137-
137+
138138
return constructor;
139139
};
140140

@@ -180,6 +180,10 @@ $.widget.bridge = function( name, object ) {
180180
this.each(function() {
181181
var methodValue,
182182
instance = $.data( this, fullName );
183+
if ( options === "instance" ) {
184+
returnValue = instance;
185+
return false;
186+
}
183187
if ( !instance ) {
184188
return $.error( "cannot call methods on " + name + " prior to initialization; " +
185189
"attempted to call method '" + options + "'" );
@@ -269,9 +273,6 @@ $.Widget.prototype = {
269273
// all event bindings should go through this._on()
270274
this.element
271275
.unbind( this.eventNamespace )
272-
// 1.9 BC for #7810
273-
// TODO remove dual storage
274-
.removeData( this.widgetName )
275276
.removeData( this.widgetFullName )
276277
// support: jquery <1.6.3
277278
// http://bugs.jquery.com/ticket/9413
@@ -347,8 +348,7 @@ $.Widget.prototype = {
347348

348349
if ( key === "disabled" ) {
349350
this.widget()
350-
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
351-
.attr( "aria-disabled", value );
351+
.toggleClass( this.widgetFullName + "-disabled", !!value );
352352
this.hoverable.removeClass( "ui-state-hover" );
353353
this.focusable.removeClass( "ui-state-focus" );
354354
}
@@ -357,10 +357,10 @@ $.Widget.prototype = {
357357
},
358358

359359
enable: function() {
360-
return this._setOption( "disabled", false );
360+
return this._setOptions({ disabled: false });
361361
},
362362
disable: function() {
363-
return this._setOption( "disabled", true );
363+
return this._setOptions({ disabled: true });
364364
},
365365

366366
_on: function( suppressDisabledCheck, element, handlers ) {

0 commit comments

Comments
 (0)