How do I use mouseenter and mouseleave events?

I am using http://cloud.github.com/downloads/emberjs/ember.js/ember-0.9.5.js

and I am not sure how to use the mouseenter and mouseleave events. My code is below and the click event is working fine. How can I get mouseenter and mouseleave events?

window.App = Ember.Application.create()

TestView = Ember.View.create
  template: Ember.Handlebars.compile 'This is the view'
  click: (evt) ->
    console.log 'clicked'
  mouseenter: (evt) ->
    console.log 'mouse enter'
  mouseleave: (evt) ->
    console.log 'mouse leave'

TestView.append()

      

+3


source to share


1 answer


Events inside Ember.js are handled Ember.EventDispatcher

and the names will be translated to the more conditional Ember.js convention if you see here .



You should change mouse events to mouseEnter

and mouseLeave

see http://jsfiddle.net/pangratz666/QtZ2T/

+12


source