aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-11-09 12:39:41 -0500
committerScott González <scott.gonzalez@gmail.com>2012-11-09 12:39:41 -0500
commit84cd214486769a3527b3ab420219c8f9c78f9879 (patch)
treed26d9728bfeeae685c0443158a1203f811335833 /tests
parent6e0a0553ce85997e4f37597800b440b1e4371b5b (diff)
downloadjquery-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 'tests')
-rw-r--r--tests/unit/widget/widget_core.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index acf461a9a..9180072e3 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -662,6 +662,46 @@ test( "._on() to element (default)", function() {
.trigger( "keydown" );
});
+test( "._on() to element with suppressDisabledCheck", function() {
+ expect( 18 );
+ var that, widget;
+ $.widget( "ui.testWidget", {
+ _create: function() {
+ that = this;
+ this._on( true, {
+ keyup: this.keyup,
+ keydown: "keydown"
+ });
+ },
+ keyup: function( event ) {
+ equal( that, this );
+ equal( that.element[0], event.currentTarget );
+ equal( "keyup", event.type );
+ },
+ keydown: function( event ) {
+ equal( that, this );
+ equal( that.element[0], event.currentTarget );
+ equal( "keydown", event.type );
+ }
+ });
+ widget = $( "<div></div>" )
+ .testWidget()
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "disable" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "enable" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+ widget
+ .testWidget( "destroy" )
+ .trigger( "keyup" )
+ .trigger( "keydown" );
+});
+
test( "._on() to descendent", function() {
expect( 12 );
var that, widget, descendant;