Bug Tracker

Ticket #3355 (closed feature: fixed)

Opened 6 years ago

Last modified 6 years ago

Add stopImmediatePropagation to event objects

Reported by: flesler Owned by: flesler
Priority: minor Milestone: 1.3
Component: event Version: 1.2.6
Keywords: stopimmediatepropagation Cc: john, joern, brandon, davidserduke
Blocking: Blocked by:

Description

We got requests in the past, for a way to stop the execution of other handlers from within one.

I realize this could be easily done, by extending event objects with a method that is already a standard (DOM 3 events, included in AS3).

Check  this and  this for additional info.

Attachments

stopImmediatePropagation[5843].diff Download (1.6 KB) - added by flesler 6 years ago.
Uses the expando to modify the event objects, doesn't break old code.

Change History

Changed 6 years ago by flesler

Uses the expando to modify the event objects, doesn't break old code.

comment:1 Changed 6 years ago by flesler

Related:

#2610, #1948, #399.

comment:3 Changed 6 years ago by joern

Good concept that fixes an annoying issue.

The patch could be improved a bit by replacing the "event[expando] == -1" bit with something more clear. Use a value that makes it obvious that its related to event propagation, not a magic number like -1.

comment:4 Changed 6 years ago by nathanhammon

Yes please. This is definitely something worth adding.

comment:5 Changed 6 years ago by flesler

The expando shouldn't be a number higher than 0, or could be misused by jQuery.data. Could be a string... but what for, it's just longer/heavier.

What would you propose Joern ?

comment:6 Changed 6 years ago by flesler

  • need changed from Review to Commit
  • Status changed from new to assigned

comment:7 Changed 6 years ago by flesler

  • Status changed from assigned to closed
  • Resolution set to fixed

Applied at [5892].

Note: See TracTickets for help on using tickets.