js/libs/ember-1.5.1.js
function(rootElement, event, eventName) {
    var self = this;

    rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {
      var view = Ember.View.views[this.id],
          result = true, manager = null;

      manager = self._findNearestEventManager(view, eventName);

      if (manager && manager !== triggeringManager) {
        result = self._dispatchEvent(manager, evt, eventName, view);
      } else if (view) {
        result = self._bubbleEvent(view, evt, eventName);
      } else {
        evt.stopPropagation();
      }

      return result;
    });

    rootElement.on(event + '.ember', '[data-ember-action]', function(evt) {
      var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),
          action   = Ember.Handlebars.ActionHelper.registeredActions[actionId];

      // We have to check for action here since in some cases, jQuery will trigger
      // an event on `removeChild` (i.e. focusout) after we've already torn down the
      // action handlers for the view.
      if (action && action.eventName === eventName) {
        return action.handler(evt);
      }
    });
  }
function(rootElement, event, eventName) {
    var self = this;

    rootElement.on(event + '.ember', '.ember-view', function(evt, triggeringManager) {
      var view = Ember.View.views[this.id],
          result = true, manager = null;

      manager = self._findNearestEventManager(view, eventName);

      if (manager && manager !== triggeringManager) {
        result = self._dispatchEvent(manager, evt, eventName, view);
      } else if (view) {
        result = self._bubbleEvent(view, evt, eventName);
      } else {
        evt.stopPropagation();
      }

      return result;
    });

    rootElement.on(event + '.ember', '[data-ember-action]', function(evt) {
      var actionId = Ember.$(evt.currentTarget).attr('data-ember-action'),
          action   = Ember.Handlebars.ActionHelper.registeredActions[actionId];

      // We have to check for action here since in some cases, jQuery will trigger
      // an event on `removeChild` (i.e. focusout) after we've already torn down the
      // action handlers for the view.
      if (action && action.eventName === eventName) {
        return action.handler(evt);
      }
    });
  }
Registers an event listener on the document. If the given event is
triggered, the provided event handler will be triggered on the target view.

If the target view does not implement the event handler, or if the handler
returns `false`, the parent view will be called. The event will continue to
bubble to each successive parent view until it reaches the top.

For example, to have the `mouseDown` method called on the target view when
a `mousedown` event is received from the browser, do the following:

```javascript
setupHandler('mousedown', 'mouseDown');
```

@private
@method setupHandler
@param {Element} rootElement
@param {String} event the browser-originated event to listen to
@param {String} eventName the name of the method to call on the view