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 20, 2019
1 parent 744d41a commit 7e3ca65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addon/adapters/rest.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* global heimdall */
/* 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 Down Expand Up @@ -32,6 +31,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 @@ -303,7 +303,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 @@ -1039,7 +1039,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 7e3ca65

Please sign in to comment.