Skip to content

Commit

Permalink
[BUGFIX jQuery] avoid jQuery deprecation notice for intentional use
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Apr 19, 2019
1 parent b596564 commit d184441
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/adapter/addon/rest.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* globals najax */
/* globals najax jQuery */
/**
@module ember-data
*/

import Ember from 'ember';
import fetch from 'fetch';
import serializeQueryParams from 'ember-fetch/utils/serialize-query-params';
import determineBodyPromise from 'ember-fetch/utils/determine-body-promise';
Expand All @@ -30,6 +29,7 @@ import { warn } from '@ember/debug';
import { DEBUG } from '@glimmer/env';

const Promise = EmberPromise;
const jQ = typeof jQuery !== 'undefined' ? jQuery : undefined;

/**
The REST adapter allows your store to communicate with an HTTP server by
Expand Down Expand Up @@ -301,7 +301,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {

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

/**
Expand Down Expand Up @@ -1026,7 +1026,7 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {
@param {Object} options jQuery ajax options to be used for the ajax request
*/
_ajaxRequest(options) {
Ember.$.ajax(options);
jQ.ajax(options);
},

/**
Expand Down

0 comments on commit d184441

Please sign in to comment.