Skip to content

Commit

Permalink
Merge pull request #36 from xkb/fix/deprecation-on-ember-post-2.2
Browse files Browse the repository at this point in the history
fix(deprecations) Use getOwner polyfill for lookup*s
  • Loading branch information
runspired committed Jan 18, 2016
2 parents 42f799e + d2598cb commit f02fffa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion addon/event_dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import defaultHammerEvents from './hammer-events';
import dasherizedToCamel from 'ember-allpurpose/string/dasherized-to-camel';
import jQuery from 'jquery';
import mobileDetection from './utils/is-mobile';
import getOwner from 'ember-getowner-polyfill';

let ROOT_ELEMENT_CLASS = 'ember-application';
let ROOT_ELEMENT_SELECTOR = '.' + ROOT_ELEMENT_CLASS;
Expand Down Expand Up @@ -47,7 +48,7 @@ export default EventDispatcher.extend({
const events = assign({}, defaultHammerEvents);

list.forEach((name) => {
const recognizer = this.container.lookupFactory('ember-gesture:recognizers/' + name);
const recognizer = getOwner(this)._lookupFactory('ember-gesture:recognizers/' + name);

if (recognizer) {
addEvent(events, recognizer.recognizer, recognizer.eventName || name);
Expand Down
5 changes: 3 additions & 2 deletions addon/services/-gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Ember from 'ember';
import camelize from 'ember-allpurpose/string/dasherized-to-camel';
import capitalize from 'ember-allpurpose/string/capitalize-word';
import getOwner from 'ember-getowner-polyfill';

const {
Service,
Expand Down Expand Up @@ -82,7 +83,7 @@ export default Service.extend({
}

const path = `ember-gesture:recognizers/${name}`;
const details = this.container.lookupFactory(path);
const details = getOwner(this)._lookupFactory(path);

if (details) {
return this.setupRecognizer(name, details);
Expand All @@ -101,7 +102,7 @@ export default Service.extend({
}

const path = `ember-gesture:recognizers/${name}`;
const details = this.container.lookupFactory(path);
const details = getOwner(this)._lookupFactory(path);

if (details) {
return this.setupRecognizer(name, details);
Expand Down
4 changes: 3 additions & 1 deletion app/instance-initializers/ember-gestures.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import getOwner from 'ember-getowner-polyfill';

export default {
name: 'ember-gestures',

Expand All @@ -6,7 +8,7 @@ export default {
instance.lookup('service:-gestures');
} else {
// This can be removed when we no-longer support ember 1.12 and 1.13
instance.container.lookup('service:-gestures');
getOwner(instance).lookup('service:-gestures');
}
}

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"ember-load-initializers": "~0.1.7",
"ember-qunit": "~0.4.18",
"ember-qunit-notifications": "~0.1.0",
"jquery": "^1.11.3",
"jquery": "1.11.3",
"loader.js": "~3.5.0",
"qunit": "~1.20.0",
"marked": "~0.3.5"
Expand Down

0 comments on commit f02fffa

Please sign in to comment.