Use @command in MarkdownPreview extension

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-10-19 12:27:45 -06:00
parent 70616aa78f
commit 503d25dff0

View File

@@ -15,11 +15,11 @@ class MarkdownPreview extends ScrollView
initialize: (@rootView) ->
super
@rootView.on 'markdown-preview:attach', =>
@rootView.command 'markdown-preview:attach', =>
path = rootView.getActiveEditor()?.getPath()
@attach() if @isMarkdownFile(path)
@on 'markdown-preview:detach', => @detach()
@command 'markdown-preview:detach', => @detach()
attach: ->
@rootView.append(this)