Commit 1f3f923a authored by Tim Zallmann's avatar Tim Zallmann

Merge branch 'remove_var_from_issue_js' into 'master'

Remove var from issue js

See merge request gitlab-org/gitlab!20098
parents 7ae80df4 5b8e90dc
/* 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