diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-01-31 21:55:22 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-01-31 21:55:22 -0500 |
commit | 17004b9cac3eb87a72474b6d82d0f0063c23c269 (patch) | |
tree | 4df5ef4e4bd62d7a0ce25c759790a49171167a3c /ui/jquery.ui.widget.js | |
parent | 3e370a44679da9c2b226d1667f13667f23bd239c (diff) | |
download | jquery-ui-17004b9cac3eb87a72474b6d82d0f0063c23c269.tar.gz jquery-ui-17004b9cac3eb87a72474b6d82d0f0063c23c269.zip |
Widget: Use focusin/focusout for ._focusable().
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 1357d40f9..4f092f9d8 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -236,7 +236,11 @@ $.Widget.prototype = { var instance = this; $.each( handlers, function( event, handler ) { element.bind( event + "." + instance.widgetName, function() { - if ( instance.options.disabled ) { + // allow widgets to customize the disabled handling + // - disabled as an array instead of boolean + // - disabled class as method for disabling individual parts + if ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) @@ -260,10 +264,10 @@ $.Widget.prototype = { _focusable: function( element ) { this.focusable = this.focusable.add( element ); this._bind( element, { - focus: function( event ) { + focusin: function( event ) { $( event.currentTarget ).addClass( "ui-state-focus" ); }, - blur: function( event ) { + focusout: function( event ) { $( event.currentTarget ).removeClass( "ui-state-focus" ); } }); |