Description
The callbacks.disabled() method is used to determine if the callbacks list has been disabled.
v1.7
This method has the form:
callbacks.disabled()
Return Value
This form returns a Boolean.
Examples
Use the callbacks.disabled()
method to if the callbacks list has been disabled:
// Add a simple logging function
var log = function(value){
console.log(value);
}
var callbacks = $.Callbacks();
// Add the function to the callbacks list
callbacks.add(log);
// fire the items on the list
callbacks.fire("test");
// Result: "test" is output
// Disable further calls
callbacks.disable();
// Output the disabled state of the list
console.log(callbacks.disabled());
// Result: "true" is output