{"name":"callbacks.disable","type":"method","title":"callbacks.disable()","deprecated":null,"removed":null,"desc":"Disable a callback list from doing anything more.","categories":["callbacks-object","version/1.7"],"entries":[{"return":"Callbacks","signatures":{"added":"1.7"},"examples":{"desc":"Use callbacks.disable() to disable further calls to a callback list:","code":"\n// A sample logging function to be added to a callbacks list\nvar foo = function( value ) {\n console.log( value );\n};\n\nvar callbacks = $.Callbacks();\n\n// Add the above function to the list\ncallbacks.add( foo );\n\n// Fire the items on the list\ncallbacks.fire( \"foo\" );\n// Outputs: foo\n\n// Disable further calls being possible\ncallbacks.disable();\n\n// Attempt to fire with \"foobar\" as an argument\ncallbacks.fire( \"foobar\" );\n// foobar isn't output\n"},"longdesc":"\n
This method returns the Callbacks object onto which it is attached (this).