From 257b2719cc3a2d7300535b2f079dcf1782235ae1 Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Wed, 12 Aug 2015 23:07:54 -0500 Subject: [PATCH] dont spin up extra run-loops when bubbling events. Fixes #11540 --- packages/ember-views/lib/system/event_dispatcher.js | 2 +- packages/ember-views/lib/views/states/has_element.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/ember-views/lib/system/event_dispatcher.js b/packages/ember-views/lib/system/event_dispatcher.js index e7ded84191b..b6896d4437d 100644 --- a/packages/ember-views/lib/system/event_dispatcher.js +++ b/packages/ember-views/lib/system/event_dispatcher.js @@ -256,7 +256,7 @@ export default EmberObject.extend({ }, _bubbleEvent(view, evt, eventName) { - return run.join(view, view.handleEvent, eventName, evt); + return view.handleEvent(eventName, evt); }, destroy() { diff --git a/packages/ember-views/lib/views/states/has_element.js b/packages/ember-views/lib/views/states/has_element.js index c03b1f1f5d5..91c7fb9ef20 100644 --- a/packages/ember-views/lib/views/states/has_element.js +++ b/packages/ember-views/lib/views/states/has_element.js @@ -1,6 +1,7 @@ import _default from 'ember-views/views/states/default'; import merge from 'ember-metal/merge'; import jQuery from 'ember-views/system/jquery'; +import run from 'ember-metal/run_loop'; /** @module ember @@ -61,7 +62,7 @@ merge(hasElement, { if (view.has(eventName)) { // Handler should be able to re-dispatch events, so we don't // preventDefault or stopPropagation. - return view.trigger(eventName, evt); + return run.join(view, view.trigger, eventName, evt); } else { return true; // continue event propagation }