aboutsummaryrefslogtreecommitdiffstats
path: root/src/callbacks.js
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2014-12-07 20:51:04 -0500
committerDave Methvin <dave.methvin@gmail.com>2014-12-07 20:51:04 -0500
commitbc1cb122db30be034b3da84ee2546c86e2a5268f (patch)
treea13e005c52a5d895661d71ec02ad99e3aeefd945 /src/callbacks.js
parent906caebb3f3bc542904a94846e778aa8d71c0575 (diff)
downloadjquery-bc1cb122db30be034b3da84ee2546c86e2a5268f.tar.gz
jquery-bc1cb122db30be034b3da84ee2546c86e2a5268f.zip
Callbacks: Disabling a callback should prevent firing
Thanks to @TheDistantSea for the report! Fixes gh-1790 Closes gh-1643
Diffstat (limited to 'src/callbacks.js')
-rw-r--r--src/callbacks.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/callbacks.js b/src/callbacks.js
index 30fa1a30f..55a9d719d 100644
--- a/src/callbacks.js
+++ b/src/callbacks.js
@@ -151,8 +151,10 @@ jQuery.Callbacks = function( options ) {
},
// Remove all callbacks from the list
empty: function() {
- list = [];
- firingLength = 0;
+ if ( list ) {
+ list = [];
+ firingLength = 0;
+ }
return this;
},
// Have the list do nothing anymore