Commit f1862602 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'merge_request' into 'master'

Remove var from merge_request.js

Closes #36271

See merge request gitlab-org/gitlab!20117
parents 39188cc1 9b554fe4
/* eslint-disable func-names, no-var, no-underscore-dangle, one-var, consistent-return */
/* eslint-disable func-names, no-underscore-dangle, consistent-return */
import $ from 'jquery';
import { __ } from '~/locale';
......@@ -64,12 +64,10 @@ MergeRequest.prototype.showAllCommits = function() {
};
MergeRequest.prototype.initMRBtnListeners = function() {
var _this;
_this = this;
const _this = this;
return $('a.btn-close, a.btn-reopen').on('click', function(e) {
var $this, shouldSubmit;
$this = $(this);
shouldSubmit = $this.hasClass('btn-comment');
const $this = $(this);
const shouldSubmit = $this.hasClass('btn-comment');
if (shouldSubmit && $this.data('submitted')) {
return;
}
......@@ -88,8 +86,7 @@ MergeRequest.prototype.initMRBtnListeners = function() {
};
MergeRequest.prototype.submitNoteForm = function(form, $button) {
var noteText;
noteText = form.find('textarea.js-note-text').val();
const noteText = form.find('textarea.js-note-text').val();
if (noteText.trim().length > 0) {
form.submit();
$button.data('submitted', true);
......@@ -99,7 +96,7 @@ MergeRequest.prototype.submitNoteForm = function(form, $button) {
MergeRequest.prototype.initCommitMessageListeners = function() {
$(document).on('click', 'a.js-with-description-link', e => {
var textarea = $('textarea.js-commit-message');
const textarea = $('textarea.js-commit-message');
e.preventDefault();
textarea.val(textarea.data('messageWithDescription'));
......@@ -108,7 +105,7 @@ MergeRequest.prototype.initCommitMessageListeners = function() {
});
$(document).on('click', 'a.js-without-description-link', e => {
var textarea = $('textarea.js-commit-message');
const textarea = $('textarea.js-commit-message');
e.preventDefault();
textarea.val(textarea.data('messageWithoutDescription'));
......
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