xyzzyrz
xyzzyrz

Reputation: 16406

What are the events Ember.js supports?

I couldn't find this documented anywhere or answered in any question. The only one I know for certain exists is 'click' (via Handling events with action).

Related questions I've seen (which don't answer my question):

Upvotes: 7

Views: 4912

Answers (3)

Alan Dong
Alan Dong

Reputation: 4095

For the sake of clarity, I just want to list here.

From ember-views/lib/system/event_dispatcher.js

List:

  events: {
    touchstart  : 'touchStart',
    touchmove   : 'touchMove',
    touchend    : 'touchEnd',
    touchcancel : 'touchCancel',
    keydown     : 'keyDown',
    keyup       : 'keyUp',
    keypress    : 'keyPress',
    mousedown   : 'mouseDown',
    mouseup     : 'mouseUp',
    contextmenu : 'contextMenu',
    click       : 'click',
    dblclick    : 'doubleClick',
    mousemove   : 'mouseMove',
    focusin     : 'focusIn',
    focusout    : 'focusOut',
    mouseenter  : 'mouseEnter',
    mouseleave  : 'mouseLeave',
    submit      : 'submit',
    input       : 'input',
    change      : 'change',
    dragstart   : 'dragStart',
    drag        : 'drag',
    dragenter   : 'dragEnter',
    dragleave   : 'dragLeave',
    dragover    : 'dragOver',
    drop        : 'drop',
    dragend     : 'dragEnd'
  },

Upvotes: 1

mehulkar
mehulkar

Reputation: 4964

Here's a list in the source as well

Upvotes: 2

pangratz
pangratz

Reputation: 16143

The supported event names are listed in http://emberjs.com/api/classes/Ember.View.html. Just search for "Possible events names":

Touch events: 'touchStart', 'touchMove', 'touchEnd', 'touchCancel'

Keyboard events: 'keyDown', 'keyUp', 'keyPress'

Mouse events: 'mouseDown', 'mouseUp', 'contextMenu', 'click', 'doubleClick', 'mouseMove', 'focusIn', 'focusOut', 'mouseEnter', 'mouseLeave'

Form events: 'submit', 'change', 'focusIn', 'focusOut', 'input'

HTML5 drag and drop events: 'dragStart', 'drag', 'dragEnter', 'dragLeave', 'drop', 'dragEnd'

Upvotes: 15

Related Questions