"parameter passed via .pluginName(methodName, param)" );
equals( param2, "value2",
"multiple parameters passed via .pluginName(methodName, param, param)" );
-
+
return this;
},
getterSetterMethod: function( val ) {
}
}
});
-
+
var elem = $( "<div>" )[ 0 ];
-
+
shouldCreate = true;
var instance = new $.ui.testWidget( {}, elem );
shouldCreate = false;
equals( $( elem ).data( "testWidget" ), instance,
"instance stored in .data(pluginName)" );
equals( instance.element[ 0 ], elem, "element stored on widget" );
-
+
var ret = instance.methodWithParams( "value1", "value2" );
equals( ret, instance, "plugin returned from method call" );
equal( msg, "no such method '_privateMethod' for testWidget widget instance",
"invalid method call on widget instance" );
};
- $( "<div>" ).testWidget().testWidget( "_privateMethod" );
+ $( "<div>" ).testWidget().testWidget( "_privateMethod" );
$.error = error;
});
calls = [];
div.testWidget( "option", "foo", "bar" );
same( calls, [{ foo: "bar" }], "_setOptions called for single option" );
-
+
calls = [];
div.testWidget( "option", {
bar: "qux",
div.testWidget( "option", "foo", "bar" );
same( calls, [{ key: "foo", val: "bar" }],
"_setOption called for single option" );
-
+
calls = [];
div.testWidget( "option", {
bar: "qux",
this._focusable( this.element.children() );
}
});
-
+
var div = $( "#widget" ).testWidget().children();
ok( !div.hasClass( "ui-state-focus" ), "not focused on init" );
div.trigger( "focusin" );
ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
div.trigger( "focusout" );
ok( !div.hasClass( "ui-state-focus" ), "not focused after blur" );
-
+
div.trigger( "focusin" );
ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
$( "#widget" ).testWidget( "disable" );
ok( !div.hasClass( "ui-state-focus" ), "can't focus while disabled" );
$( "#widget" ).testWidget( "enable" );
ok( !div.hasClass( "ui-state-focus" ), "enabling doesn't reset focus" );
-
+
div.trigger( "focusin" );
ok( div.hasClass( "ui-state-focus" ), "focused after explicit focus" );
$( "#widget" ).testWidget( "destroy" );