Commit 2764ade4 authored by Lukas Eipert's avatar Lukas Eipert

Replace jquery.get with Rails.ajax

In the code below jQuery.get is used in order to download javascript
that is then executed. In order to move away from jQuery ajax, we can
utilize Rails.ajax which does the same thing.
parent 46527a69
import $ from 'jquery';
import { Rails } from '~/lib/utils/rails_ujs';
import projectNew from '~/projects/project_new';
const bindEvents = () => {
......@@ -125,13 +126,11 @@ export default () => {
$groupTabContent.on('ajax:success', bindEvents);
$navElement.one('click', () => {
// eslint-disable-next-line no-jquery/no-ajax
$.get($tabContent.data('initialTemplates'));
Rails.ajax({ url: $tabContent.data('initialTemplates'), type: 'GET' });
});
$groupNavElement.one('click', () => {
// eslint-disable-next-line no-jquery/no-ajax
$.get($groupTabContent.data('initialTemplates'));
Rails.ajax({ url: $groupTabContent.data('initialTemplates'), type: 'GET' });
});
bindEvents();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment