forked from jquery/api.jquery.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallbacks.disabled.xml
36 lines (31 loc) · 983 Bytes
/
callbacks.disabled.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?xml version="1.0"?>
<entry name="callbacks.disabled" type="method" return="Boolean">
<title>callbacks.disabled()</title>
<signature>
<added>1.7</added>
</signature>
<desc>Determine if the callbacks list has been disabled.</desc>
<longdesc/>
<example>
<desc>Use <code>callbacks.disabled()</code> to determine if the callbacks list has been disabled:</desc>
<code><![CDATA[
// A sample logging function to be added to a callbacks list
var foo = function( value ) {
console.log( "foo:" + value );
};
var callbacks = $.Callbacks();
// Add the logging function to the callback list
callbacks.add( foo );
// Fire the items on the list, passing an argument
callbacks.fire( "hello" );
// Outputs "foo: hello"
// Disable the callbacks list
callbacks.disable();
// Test the disabled state of the list
console.log ( callbacks.disabled() );
// Outputs: true
]]></code>
</example>
<category slug="callbacks-object"/>
<category slug="version/1.7"/>
</entry>