});
test( "jQuery usage", function() {
- expect( 16 );
+ expect( 14 );
- var elem, instance, ret, bcInstance,
+ var elem, instance, ret,
shouldCreate = false;
$.widget( "ui.testWidget", {
ret = elem.testWidget( "methodWithParams", "value1", "value2" );
equal( ret, elem, "jQuery object returned from method call" );
- // 1.9 BC for #7810
- // TODO remove
- bcInstance = elem.data("testWidget");
- equal( typeof bcInstance, "object", "instance stored in .data(pluginName)" );
- equal( bcInstance.element[0], elem[0], "element stored on widget" );
-
ret = elem.testWidget( "getterSetterMethod" );
equal( ret, 5, "getter/setter can act as getter" );
ret = elem.testWidget( "getterSetterMethod", 30 );
ok( true, "handler triggered" );
}
});
- var widget = $( "#widget" ).testWidget().data( "testWidget" );
+ var widget = $( "#widget" ).testWidget().data( "ui-testWidget" );
$( "#widget-wrapper" ).testWidget();
widget.destroy();
$( document ).trigger( "customevent" );
$.widget( "ui.testWidget", {} );
var shouldTriggerWidget, shouldTriggerOther,
element = $( "#widget" ),
- widget = element.testWidget().data( "testWidget" );
+ widget = element.testWidget().data( "ui-testWidget" );
widget._on( element, { foo: function() {
ok( shouldTriggerWidget, "foo called from _on" );
}});
$.widget( "ui.testWidget", {} );
var shouldTriggerWidget, shouldTriggerOther,
element = $( "#widget" ),
- widget = element.testWidget().data( "testWidget" );
+ widget = element.testWidget().data( "ui-testWidget" );
widget._on( element, {
foo: function() {
ok( shouldTriggerWidget, "foo called from _on" );
$.widget( "ui.testWidget", {} );
var shouldTriggerWidget, shouldTriggerOther,
element = $( "#widget" ),
- widget = element.testWidget().data( "testWidget" );
+ widget = element.testWidget().data( "ui-testWidget" );
widget._on( element, {
foo: function() {
ok( shouldTriggerWidget, "foo called from _on" );