Update coffeescript to bind events outside of function