Commit f4ffffff authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'project' into 'master'

Remove var from project.js

Closes #36287

See merge request gitlab-org/gitlab!20507
parents 8bad7aae afe9c03b
/* eslint-disable func-names, no-var, no-return-assign */ /* eslint-disable func-names, no-return-assign */
import $ from 'jquery'; import $ from 'jquery';
import Cookies from 'js-cookie'; import Cookies from 'js-cookie';
...@@ -90,19 +90,19 @@ export default class Project { ...@@ -90,19 +90,19 @@ export default class Project {
} }
static initRefSwitcher() { static initRefSwitcher() {
var refListItem = document.createElement('li'); const refListItem = document.createElement('li');
var refLink = document.createElement('a'); const refLink = document.createElement('a');
refLink.href = '#'; refLink.href = '#';
return $('.js-project-refs-dropdown').each(function() { return $('.js-project-refs-dropdown').each(function() {
var $dropdown = $(this); const $dropdown = $(this);
var selected = $dropdown.data('selected'); const selected = $dropdown.data('selected');
var fieldName = $dropdown.data('fieldName'); const fieldName = $dropdown.data('fieldName');
var shouldVisit = Boolean($dropdown.data('visit')); const shouldVisit = Boolean($dropdown.data('visit'));
var $form = $dropdown.closest('form'); const $form = $dropdown.closest('form');
var action = $form.attr('action'); const action = $form.attr('action');
var linkTarget = mergeUrlParams(serializeForm($form[0]), action); const linkTarget = mergeUrlParams(serializeForm($form[0]), action);
return $dropdown.glDropdown({ return $dropdown.glDropdown({
data(term, callback) { data(term, callback) {
...@@ -123,9 +123,9 @@ export default class Project { ...@@ -123,9 +123,9 @@ export default class Project {
inputFieldName: $dropdown.data('inputFieldName'), inputFieldName: $dropdown.data('inputFieldName'),
fieldName, fieldName,
renderRow(ref) { renderRow(ref) {
var li = refListItem.cloneNode(false); const li = refListItem.cloneNode(false);
var link = refLink.cloneNode(false); const link = refLink.cloneNode(false);
if (ref === selected) { if (ref === selected) {
link.className = 'is-active'; link.className = 'is-active';
......
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