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

*爱你&永不变心* 提交于 2019-11-28 07:13:06

问题


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?


回答1:


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');


来源:https://stackoverflow.com/questions/6157435/with-the-ace-editor-how-can-i-unbind-an-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!