deepEqual( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" );
});
+test( "redeclare", function() {
+ expect( 2 );
+
+ $.widget( "ui.testWidget", {} );
+ equal( $.ui.testWidget.prototype.widgetEventPrefix, "testWidget" );
+
+ $.widget( "ui.testWidget", {} );
+ equal( $.ui.testWidget.prototype.widgetEventPrefix, "testWidget" );
+});
+
test( "inheritance", function() {
expect( 6 );
// #5830 - Widget: Using inheritance overwrites the base classes options
// 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: existingConstructor ? basePrototype.widgetEventPrefix : name
+ widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,