benchmarks/scenarios/ember.js
function (rootElement, event, eventName) {
      var self = this;

      var owner = _containerOwner.getOwner(this);
      var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsViewsView.default.views;

      if (eventName === null) {
        return;
      }

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

        var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null;

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

        return result;
      });

      rootElement.on(event + '.ember', '[data-ember-action]', function (evt) {
        var actionId = _emberViewsSystemJquery.default(evt.currentTarget).attr('data-ember-action');
        var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId];

        // We have to check for actions 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 (!actions) {
          return;
        }

        for (var index = 0, _length = actions.length; index < _length; index++) {
          var action = actions[index];

          if (action && action.eventName === eventName) {
            return action.handler(evt);
          }
        }
      });
    }
function (rootElement, event, eventName) {
      var self = this;

      var owner = _containerOwner.getOwner(this);
      var viewRegistry = owner && owner.lookup('-view-registry:main') || _emberViewsViewsView.default.views;

      if (eventName === null) {
        return;
      }

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

        var manager = self.canDispatchToEventManager ? self._findNearestEventManager(view, eventName) : null;

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

        return result;
      });

      rootElement.on(event + '.ember', '[data-ember-action]', function (evt) {
        var actionId = _emberViewsSystemJquery.default(evt.currentTarget).attr('data-ember-action');
        var actions = _emberViewsSystemAction_manager.default.registeredActions[actionId];

        // We have to check for actions 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 (!actions) {
          return;
        }

        for (var index = 0, _length = actions.length; index < _length; index++) {
          var action = actions[index];

          if (action && action.eventName === eventName) {
            return action.handler(evt);
          }
        }
      });
    }
function ( rootElement , event , eventName ) { var self = this ; var owner = _containerOwner . getOwner ( this ) ; var viewRegistry = owner && owner . lookup ( '-view-registry:main' ) || _emberViewsViewsView . default . views ; if ( eventName === null ) { return ; } rootElement . on ( event + '.ember' , '.ember-view' , function ( evt , triggeringManager ) { var view = viewRegistry [ this . id ] ; var result = true ; var manager = self . canDispatchToEventManager ? self . _findNearestEventManager ( view , eventName ) : null ; if ( manager && manager !== triggeringManager ) { result = self . _dispatchEvent ( manager , evt , eventName , view ) ; } else if ( view ) { result = self . _bubbleEvent ( view , evt , eventName ) ; } return result ; } ) ; rootElement . on ( event + '.ember' , '[data-ember-action]' , function ( evt ) { var actionId = _emberViewsSystemJquery . default ( evt . currentTarget ) . attr ( 'data-ember-action' ) ; var actions = _emberViewsSystemAction_manager . default . registeredActions [ actionId ] ; // We have to check for actions 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 ( ! actions ) { return ; } for ( var index = 0 , _length = actions . length ; index < _length ; index ++ ) { var action = actions [ index ] ; if ( action && action . eventName === eventName ) { return action . handler ( evt ) ; } } } ) ; }
Registers an event listener on the rootElement. 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.
@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
Registers an event listener on the rootElement . 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 .