Skip to main content

Bug Tracker

Side navigation

#10952 closed bug (fixed)

Opened December 05, 2011 06:22PM UTC

Closed January 31, 2012 01:32AM UTC

Last modified March 08, 2012 04:50PM UTC

.fired() doesn't work on Callbacks object when it is flagged with "once"

Reported by: dtipson@gmail.com Owned by: jaubourg
Priority: low Milestone: 1.7.2
Component: misc Version: 1.7.1
Keywords: Cc: jaubourg
Blocked by: Blocking:
Description

Adding the flags "once" or "once unique" to a callbacks object seems to disable the ability of .fired() to accurately reflect whether or not it was fired at least once. It always returns false, no matter how many times you fire the callback (it will only fire its functions once, obviously, but at that point it should be flagged as fired/resolved). This means that there is no simple way to tell if a callback has fired already (which is useful for triggering other loosely coupled behavior).

http://jsfiddle.net/XmPze/27/

Same (wrong?) behavior in both 1.7 and 1.7.1

Attachments (0)
Change History (3)

Changed December 08, 2011 10:39AM UTC by addyosmani comment:1

cc: → jaubourg
component: unfiledmisc
priority: undecidedlow

Changed January 23, 2012 05:05PM UTC by jaubourg comment:2

milestone: None1.7.2
owner: → jaubourg
status: newassigned

Changed January 31, 2012 01:32AM UTC by jaubourg comment:3

resolution: → fixed
status: assignedclosed

Fixes #10952 by introducing a real fired flag in the Callbacks closure.

jQuery Size - compared to last make

250235 (+69) jquery.js

94225 (+7) jquery.min.js

33445 (+3) jquery.min.js.gz

Changeset: eefead3d9629d68407600831a23c58a25163489e