#8724 closed bug (fixed)
widgetEventPrefix is lost when extending existing widget
Reported by: | nix | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.1 |
Component: | ui.widget | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Tested with dcb671539286dcc58b7e6ffa6035c647500e699a:
$.widget( "foo.bar", { widgetEventPrefix: "baz", ... _someMethod: function() { ... this._trigger( "event" ); ... }, }); $.widget( "foo.bar", $.foo.bar, { ... _someOtherMethod: function() { ... } ... });
When a widget is declared like this, the widgetEventPrefix is lost when the extension is applied. You can re-add it with an additional
$.widget( "foo.bar", $.foo.bar, { widgetEventPrefix: "baz" });
after the declaration of the first extension. Nevertheless, the original should be preserved after the first extension is added, otherwise it's impossible to create optional extensions.
Here's a jsbin with a simple example: http://jsbin.com/uguxuw/4/edit
Change History (3)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Widget: Use existing widgetEventPrefix when extending. Fixes #8724 - widgetEventPrefix is lost when extending existing widget.
Changeset: 848ab485839b6dd26f2b6c6680141d95cab32ceb
comment:3 Changed 11 years ago by
Milestone: | 1.10.0 → 1.9.1 |
---|---|
Version: | git → 1.9.0 |
Note: See
TracTickets for help on using
tickets.
It might also be worth looking at whether other items besides widgetEventPrefix are also lost in the extension process.