Skip to main content

Search and Top Navigation

#8724 closed bug (fixed)

Opened October 24, 2012 09:15AM UTC

Closed October 24, 2012 02:14PM UTC

Last modified October 24, 2012 02:14PM UTC

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

Attachments (0)
Change History (3)

Changed October 24, 2012 09:17AM UTC by nix comment:1

It might also be worth looking at whether other items besides widgetEventPrefix are also lost in the extension process.

Changed October 24, 2012 02:14PM UTC by Scott González comment:2

resolution: → fixed
status: newclosed

Widget: Use existing widgetEventPrefix when extending. Fixes #8724 - widgetEventPrefix is lost when extending existing widget.

Changeset: 848ab485839b6dd26f2b6c6680141d95cab32ceb

Changed October 24, 2012 02:14PM UTC by scottgonzalez comment:3

milestone: 1.10.01.9.1
version: git1.9.0