Last active
August 29, 2015 14:01
-
-
Save minodisk/00d8322a4a328d033ff7 to your computer and use it in GitHub Desktop.
WorkspaceView#command() を off() する方法
Author
minodisk
commented
May 12, 2014
Author
https://github.com/atom/space-pen/blob/v3.1.1/src/jquery-extensions.coffee#L146
$.fn.command = (eventName, selector, options, handler) ->
...
@document(eventName, _.humanizeEventName(eventName, options?['doc']))
@on(eventName, selector, options?['data'], handler)https://github.com/atom/space-pen/blob/v3.1.1/src/jquery-extensions.coffee#L116
$.fn.document = (eventName, docString) ->
eventDescriptions = {}
eventDescriptions[eventName] = docString
@data('documentation', {}) unless @data('documentation')
_.extend(@data('documentation'), eventDescriptions)@document()ではworkspaceView.data('documentation')にeventName/docStringを登録してるだけで、イベント自体はjQueryのon()で聞いてる。よってoffしたい時は普通にoffすればよいぽい。
atom.workspaceView.command 'hoge:action', handler
atom.workspaceView.off 'hoge:action', handler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment