aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r--ui/jquery.ui.widget.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 885e2019f..a46dcaf99 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -203,7 +203,10 @@ $.widget.bridge = function( name, object ) {
this.each(function() {
var instance = $.data( this, fullName );
if ( instance ) {
- instance.option( options || {} )._init();
+ instance.option( options || {} );
+ if ( instance._init ) {
+ instance._init();
+ }
} else {
$.data( this, fullName, new object( options, this ) );
}
@@ -349,8 +352,12 @@ $.Widget.prototype = {
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled", !!value );
- this.hoverable.removeClass( "ui-state-hover" );
- this.focusable.removeClass( "ui-state-focus" );
+
+ // If the widget is becoming disabled, then nothing is interactive
+ if ( value ) {
+ this.hoverable.removeClass( "ui-state-hover" );
+ this.focusable.removeClass( "ui-state-focus" );
+ }
}
return this;