Skip to content

Instantly share code, notes, and snippets.

@jzaefferer
Created June 10, 2012 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jzaefferer/7325217f7f3c78f45457 to your computer and use it in GitHub Desktop.
Save jzaefferer/7325217f7f3c78f45457 to your computer and use it in GitHub Desktop.
test( "_bind() to common element", function() {
expect( 1 );
$.widget( "ui.testWidget", {
_create: function() {
this._bind( this.document, {
"customevent": "_handler"
});
},
_handler: function() {
ok( true, "handler triggered" );
},
trigger: function() {
this.document.trigger( "customevent" );
}
});
var widget1 = $( "#widget" ).testWidget().data( "testWidget" ),
widget2 = $.ui.testWidget();
widget1.destroy();
widget2.trigger();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment