aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-01-31 02:31:22 +0100
committerjaubourg <j@ubourg.net>2012-01-31 02:31:22 +0100
commiteefead3d9629d68407600831a23c58a25163489e (patch)
treefcd3e4c453b0677e175243bb3b71b9d12e6e007a
parent6eba066573db377a0e565ac010346b6c9e718a04 (diff)
downloadjquery-eefead3d9629d68407600831a23c58a25163489e.tar.gz
jquery-eefead3d9629d68407600831a23c58a25163489e.zip
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
-rw-r--r--src/callbacks.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/callbacks.js b/src/callbacks.js
index 6ae4971fb..387868604 100644
--- a/src/callbacks.js
+++ b/src/callbacks.js
@@ -48,6 +48,8 @@ jQuery.Callbacks = function( flags ) {
stack = [],
// Last fire value (for non-forgettable lists)
memory,
+ // Flag to know if list was already fired
+ fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
@@ -81,6 +83,7 @@ jQuery.Callbacks = function( flags ) {
fire = function( context, args ) {
args = args || [];
memory = !flags.memory || [ context, args ];
+ fired = true;
firing = true;
firingIndex = firingStart || 0;
firingStart = 0;
@@ -216,7 +219,7 @@ jQuery.Callbacks = function( flags ) {
},
// To know if the callbacks have already been called at least once
fired: function() {
- return !!memory;
+ return !!fired;
}
};