Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With the ACE Editor, how can I unbind an event?

https://github.com/ajaxorg/ace/wiki/Embedding---API

editor.session.on('change', callback);

is how you bind an event to "change". But how do I unbind it?

like image 737
Shamoon Avatar asked May 27 '11 20:05

Shamoon


1 Answers

Use removeListener to remove a specific callback.

editor.session.removeListener('change', callback);

or a shorter version

editor.session.off('change', callback);

Use removeAllListeners to remove all callbacks.

editor.session.removeAllListeners('change');
like image 176
Mrchief Avatar answered Sep 26 '22 21:09

Mrchief