On click events


I want to tie an action to a button. I was trying to put it in the initialize or activate method. Any thoughts?

atom.workspaceView.find(".close-button").on "click", ->
  console.log "Hello"

OK, I have had it

Maybe this can help.


Could also just bind at the root of the DOM and filter out the events you need:

atom.workspaceView.on 'click', '.close-button', ->
  console.log 'hi'