#923 closed bug (fixed)
Global triggers can execute handlers multiple times
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | 1.1.3 |
Component: | event | Version: | |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description (last modified by )
If two global handlers for the same event type are attached to the same element, the handlers will each fire twice. For example:
$('#foo').ajaxComplete(function() {
alert('foo');
}); $('#foo').ajaxComplete(function() {
alert('bar');
});
When a request completes, we will see four alerts, not two.
This is due to the flow of "trigger: function(type, data, element)". This calls .trigger() on each element, which in turn calls each handler. To fix, the function probably needs to first winnow the matched elements down to a unique set before the recursive call to .trigger().
Change History (2)
comment:1 Changed 16 years ago by
Milestone: | → 1.1.3 |
---|---|
need: | → Test Case |
comment:2 Changed 16 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
This is now fixed in Rev [2011].