deepEqual( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" );
});
-test( "inheritance - options", function() {
- expect( 4 );
+test( "inheritance", function() {
+ expect( 6 );
// #5830 - Widget: Using inheritance overwrites the base classes options
$.widget( "ui.testWidgetBase", {
options: {
}
});
+ equal( $.ui.testWidgetBase.prototype.widgetEventPrefix, "testWidgetBase",
+ "base class event prefix" );
deepEqual( $.ui.testWidgetBase.prototype.options.obj, {
key1: "foo",
key2: "bar"
deepEqual( $.ui.testWidgetBase.prototype.options.arr, [ "testing" ],
"base class option array not overridden");
+ equal( $.ui.testWidgetExtension.prototype.widgetEventPrefix, "testWidgetExtension",
+ "extension class event prefix" );
deepEqual( $.ui.testWidgetExtension.prototype.options.obj, {
key1: "baz",
key2: "bar"
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
- widgetEventPrefix: basePrototype.widgetEventPrefix || name
+ widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
}, prototype, {
constructor: constructor,
namespace: namespace,