diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-11-09 12:39:41 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-11-09 12:39:41 -0500 |
commit | 84cd214486769a3527b3ab420219c8f9c78f9879 (patch) | |
tree | d26d9728bfeeae685c0443158a1203f811335833 /ui | |
parent | 6e0a0553ce85997e4f37597800b440b1e4371b5b (diff) | |
download | jquery-ui-84cd214486769a3527b3ab420219c8f9c78f9879.tar.gz jquery-ui-84cd214486769a3527b3ab420219c8f9c78f9879.zip |
Widget: Added suppressDisabledCheck flag to _on(). Fixes #8800 - Widget: Ability to use _on() even when disabled.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.widget.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 5a069f2ef..83696e940 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -359,9 +359,17 @@ $.Widget.prototype = { return this._setOption( "disabled", true ); }, - _on: function( element, handlers ) { + _on: function( suppressDisabledCheck, element, handlers ) { var delegateElement, instance = this; + + // no suppressDisabledCheck flag, shuffle arguments + if ( typeof suppressDisabledCheck !== "boolean" ) { + handlers = element; + element = suppressDisabledCheck; + suppressDisabledCheck = false; + } + // no element argument, shuffle and use this.element if ( !handlers ) { handlers = element; @@ -378,8 +386,9 @@ $.Widget.prototype = { // 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" ) ) { + if ( !suppressDisabledCheck && + ( instance.options.disabled === true || + $( this ).hasClass( "ui-state-disabled" ) ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) |