Commit 87f57f5a authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch '321859-template-with-rails-ajax' into 'master'

Replace jquery.get with Rails.ajax

See merge request gitlab-org/gitlab!55158
parents d7fe47dd 2764ade4
import $ from 'jquery'; import $ from 'jquery';
import { Rails } from '~/lib/utils/rails_ujs';
import projectNew from '~/projects/project_new'; import projectNew from '~/projects/project_new';
const bindEvents = () => { const bindEvents = () => {
...@@ -125,13 +126,11 @@ export default () => { ...@@ -125,13 +126,11 @@ export default () => {
$groupTabContent.on('ajax:success', bindEvents); $groupTabContent.on('ajax:success', bindEvents);
$navElement.one('click', () => { $navElement.one('click', () => {
// eslint-disable-next-line no-jquery/no-ajax Rails.ajax({ url: $tabContent.data('initialTemplates'), type: 'GET' });
$.get($tabContent.data('initialTemplates'));
}); });
$groupNavElement.one('click', () => { $groupNavElement.one('click', () => {
// eslint-disable-next-line no-jquery/no-ajax Rails.ajax({ url: $groupTabContent.data('initialTemplates'), type: 'GET' });
$.get($groupTabContent.data('initialTemplates'));
}); });
bindEvents(); 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