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

Commit

Permalink
Widget Factory: update to lastest from ui
Browse files Browse the repository at this point in the history
  • Loading branch information
arschmitz committed Aug 5, 2013
1 parent 17ae60a commit 6fa8ecf
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions js/jquery.ui.widget.js
@@ -1,5 +1,5 @@
/*!
* jQuery UI Widget 1.10.1
* jQuery UI Widget @VERSION
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
Expand Down Expand Up @@ -106,7 +106,7 @@ $.widget = function( name, base, prototype ) {
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
Expand Down Expand Up @@ -134,7 +134,7 @@ $.widget = function( name, base, prototype ) {
}

$.widget.bridge( name, constructor );

return constructor;
};

Expand Down Expand Up @@ -180,6 +180,10 @@ $.widget.bridge = function( name, object ) {
this.each(function() {
var methodValue,
instance = $.data( this, fullName );
if ( options === "instance" ) {
returnValue = instance;
return false;
}
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
Expand Down Expand Up @@ -269,9 +273,6 @@ $.Widget.prototype = {
// all event bindings should go through this._on()
this.element
.unbind( this.eventNamespace )
// 1.9 BC for #7810
// TODO remove dual storage
.removeData( this.widgetName )
.removeData( this.widgetFullName )
// support: jquery <1.6.3
// http://bugs.jquery.com/ticket/9413
Expand Down Expand Up @@ -347,8 +348,7 @@ $.Widget.prototype = {

if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
.attr( "aria-disabled", value );
.toggleClass( this.widgetFullName + "-disabled", !!value );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}
Expand All @@ -357,10 +357,10 @@ $.Widget.prototype = {
},

enable: function() {
return this._setOption( "disabled", false );
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOption( "disabled", true );
return this._setOptions({ disabled: true });
},

_on: function( suppressDisabledCheck, element, handlers ) {
Expand Down

0 comments on commit 6fa8ecf

Please sign in to comment.