Skip to content

Commit 7e3ca65

Browse files
committed
[BUGFIX jQuery] avoid jQuery deprecation notice for intentional use
1 parent 744d41a commit 7e3ca65

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

addon/adapters/rest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
/* global heimdall */
2-
/* globals najax */
2+
/* globals najax jQuery */
33
/**
44
@module ember-data
55
*/
66

7-
import Ember from 'ember';
87
import fetch from 'fetch';
98
import serializeQueryParams from 'ember-fetch/utils/serialize-query-params';
109
import determineBodyPromise from 'ember-fetch/utils/determine-body-promise';
@@ -32,6 +31,7 @@ import { warn } from '@ember/debug';
3231
import { DEBUG } from '@glimmer/env';
3332

3433
const Promise = EmberPromise;
34+
const jQ = typeof jQuery !== 'undefined' ? jQuery : undefined;
3535

3636
/**
3737
The REST adapter allows your store to communicate with an HTTP server by
@@ -303,7 +303,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {
303303

304304
useFetch: computed(function() {
305305
let ENV = getOwner(this).resolveRegistration('config:environment');
306-
return (ENV && ENV._JQUERY_INTEGRATION) === false || Ember.$ === undefined;
306+
return (ENV && ENV._JQUERY_INTEGRATION) === false || jQ === undefined;
307307
}),
308308

309309
/**
@@ -1039,7 +1039,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {
10391039
@param {Object} options jQuery ajax options to be used for the ajax request
10401040
*/
10411041
_ajaxRequest(options) {
1042-
Ember.$.ajax(options);
1042+
jQ.ajax(options);
10431043
},
10441044

10451045
/**

0 commit comments

Comments
 (0)