Skip to content

Commit 122aa38

Browse files
committed
Add callbacks.disabled entry
1 parent cd94e78 commit 122aa38

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

entries/callbacks.disabled.xml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0"?>
2+
<entry name="callbacks.locked" type="method" return="Boolean">
3+
<title>callbacks.locked()</title>
4+
<signature>
5+
<added>1.7</added>
6+
</signature>
7+
<desc>Determine if the callbacks list has been disabled.</desc>
8+
<longdesc/>
9+
<example>
10+
<desc>Use <code>callbacks.disabled()</code> to determine if the callbacks list has been disabled:</desc>
11+
<code><![CDATA[// a sample logging function to be added to a callbacks list
12+
var foo = function( value ) {
13+
console.log( "foo:" + value );
14+
};
15+
16+
var callbacks = $.Callbacks();
17+
18+
// add the logging function to the callback list
19+
callbacks.add( foo );
20+
21+
// fire the items on the list, passing an argument
22+
callbacks.fire( "hello" );
23+
// outputs "foo: hello"
24+
25+
// disable the callbacks list
26+
callbacks.disable();
27+
28+
// test the disabled state of the list
29+
console.log ( callbacks.disabled() );
30+
// outputs: true
31+
]]></code>
32+
</example>
33+
<category slug="callbacks-object"/>
34+
<category slug="version/1.7"/>
35+
</entry>

0 commit comments

Comments
 (0)