On click events


#1

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
#2

Maybe this can help.


#3

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'