Commit 5b8e90dc authored by Lee Tickett's avatar Lee Tickett Committed by Tim Zallmann

Remove var from issue js

parent 7ae80df4
/* eslint-disable no-var, one-var, consistent-return */
/* eslint-disable consistent-return */
import $ from 'jquery';
import axios from './lib/utils/axios_utils';
......@@ -91,18 +91,17 @@ export default class Issue {
'click',
'.js-issuable-actions a.btn-close, .js-issuable-actions a.btn-reopen',
e => {
var $button, shouldSubmit, url;
e.preventDefault();
e.stopImmediatePropagation();
$button = $(e.currentTarget);
shouldSubmit = $button.hasClass('btn-comment');
const $button = $(e.currentTarget);
const shouldSubmit = $button.hasClass('btn-comment');
if (shouldSubmit) {
Issue.submitNoteForm($button.closest('form'));
}
this.disableCloseReopenButton($button);
url = $button.attr('href');
const url = $button.attr('href');
return axios
.put(url)
.then(({ data }) => {
......@@ -139,16 +138,14 @@ export default class Issue {
}
static submitNoteForm(form) {
var noteText;
noteText = form.find('textarea.js-note-text').val();
const noteText = form.find('textarea.js-note-text').val();
if (noteText && noteText.trim().length > 0) {
return form.submit();
}
}
static initRelatedBranches() {
var $container;
$container = $('#related-branches');
const $container = $('#related-branches');
return axios
.get($container.data('url'))
.then(({ data }) => {
......
---
title: Remove var from issue.js
merge_request: 20098
author: Lee Tickett
type: other
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