Skip to main content

Bug Tracker

Side navigation

#873 closed bug (fixed)

Opened January 24, 2007 05:31AM UTC

Closed August 30, 2007 05:51AM UTC

Re-work Triggered Events

Reported by: john Owned by:
Priority: major Milestone: 1.2
Component: event Version: 1.1.4
Keywords: Cc:
Blocked by: Blocking:
Description

This is how event triggering should be re-worked:

.trigger("event"):

  • Should be cancellable.
  • Should only trigger bound event handlers.

.triggerAction("event")

  • Should trigger default browser action
  • Should not be cancellable
  • Should not allow clicking on links in IE
  • If no action exists, call trigger("event")

.click()

  • Should use triggerAction
Attachments (0)
Change History (6)

Changed March 24, 2007 06:22PM UTC by john comment:1

description: Currently, it can only be canceled using return false - it should work both ways.This is how event triggering should be re-worked:\ \ .trigger("event"):\ * Should be cancellable.\ * Should only trigger bound event handlers.\ \ .triggerAction("event")\ * Should trigger default browser action\ * Should not be cancellable\ * Should not allow clicking on links in IE\ * If no action exists, call trigger("event")\ \ .click()\ * Should use triggerAction
need: → Test Case
summary: A triggered event can't be canceled with .preventDefault()Re-work Triggered Events

Changed March 28, 2007 07:16PM UTC by brandon comment:2

So .click() will only use triggerAction and will not use trigger at all?

Changed March 29, 2007 06:13PM UTC by john comment:3

Correct - but triggerAction will call trigger if no default action exists. (Since default actions end up triggering the event handlers anyway.)

Changed May 31, 2007 04:25AM UTC by brandon comment:4

description: This is how event triggering should be re-worked:\ \ .trigger("event"):\ * Should be cancellable.\ * Should only trigger bound event handlers.\ \ .triggerAction("event")\ * Should trigger default browser action\ * Should not be cancellable\ * Should not allow clicking on links in IE\ * If no action exists, call trigger("event")\ \ .click()\ * Should use triggerActionThis is how event triggering should be re-worked: \ \ .trigger("event"): \ * Should be cancellable. \ * Should only trigger bound event handlers. \ \ .triggerAction("event") \ * Should trigger default browser action \ * Should not be cancellable \ * Should not allow clicking on links in IE \ * If no action exists, call trigger("event") \ \ .click() \ * Should use triggerAction

A related ticket is #1192.

Changed June 07, 2007 05:56PM UTC by julienw comment:5

I'd like to swap "trigger" and "triggerAction" in this description. otherwise, existing script that use "trigger" to trigger default browser actions would break ! :)

On the other hand, "triggerAction" would give a new feature... and that's exactly what your description of "trigger" is.

Changed August 30, 2007 05:51AM UTC by john comment:6

milestone: 1.1.31.2
resolution: → fixed
status: newclosed
version: 1.11.1.4

Fixed in SVN rev [3008].