diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2014-12-07 20:51:04 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2014-12-07 20:51:04 -0500 |
commit | bc1cb122db30be034b3da84ee2546c86e2a5268f (patch) | |
tree | a13e005c52a5d895661d71ec02ad99e3aeefd945 /src/callbacks.js | |
parent | 906caebb3f3bc542904a94846e778aa8d71c0575 (diff) | |
download | jquery-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.js | 6 |
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 |