Callbacks: Disabling a callback should prevent firing

Thanks to @TheDistantSea for the report!

Fixes gh-1790
Closes gh-1643
(cherry picked from commit bc1cb122db)
This commit is contained in:
Dave Methvin
2014-12-07 20:51:04 -05:00
parent faf295a6d8
commit 61df648651
2 changed files with 19 additions and 2 deletions

View File

@@ -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