diff --git a/packages/ember-views/lib/mixins/view_support.js b/packages/ember-views/lib/mixins/view_support.js index cb6eb27c05d..0ae781657a8 100644 --- a/packages/ember-views/lib/mixins/view_support.js +++ b/packages/ember-views/lib/mixins/view_support.js @@ -1,4 +1,4 @@ -import { guidFor } from 'ember-utils'; +import { guidFor, getOwner } from 'ember-utils'; import { assert, deprecate, descriptor, Mixin } from 'ember-metal'; import { environment } from 'ember-environment'; import { matches } from '../system/utils'; @@ -441,6 +441,18 @@ export default Mixin.create({ this.elementId = guidFor(this); } + // if we find an `eventManager` property, deopt the + // `EventDispatcher`'s `canDispatchToEventManager` property + // if `null` + if (this.eventManager) { + let owner = getOwner(this); + let dispatcher = owner && owner.lookup('event_dispatcher:main'); + + if (dispatcher && dispatcher.canDispatchToEventManager === null) { + dispatcher.canDispatchToEventManager = true; + } + } + deprecate( `[DEPRECATED] didInitAttrs called in ${this.toString()}.`, typeof(this.didInitAttrs) !== 'function', diff --git a/packages/ember-views/lib/system/event_dispatcher.js b/packages/ember-views/lib/system/event_dispatcher.js index c643f6d8810..24c2f825a6e 100644 --- a/packages/ember-views/lib/system/event_dispatcher.js +++ b/packages/ember-views/lib/system/event_dispatcher.js @@ -126,11 +126,11 @@ export default EmberObject.extend({ @property canDispatchToEventManager @type boolean - @default 'true' + @default false @since 1.7.0 @private */ - canDispatchToEventManager: true, + canDispatchToEventManager: null, init() { this._super();