Commit ec811626 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'remove_var_from_tree_js' into 'master'

Remove var from tree.js

Closes #36273

See merge request gitlab-org/gitlab!20103
parents 25d267d6 f395bded
/* eslint-disable func-names, consistent-return, no-var, one-var, no-else-return, class-methods-use-this */
/* eslint-disable func-names, consistent-return, one-var, no-else-return, class-methods-use-this */
import $ from 'jquery';
import { visitUrl } from './lib/utils/url_utility';
......@@ -9,9 +9,8 @@ export default class TreeView {
// Code browser tree slider
// Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
$('.tree-content-holder .tree-item').on('click', function(e) {
var $clickedEl, path;
$clickedEl = $(e.target);
path = $('.tree-item-file-name a', this).attr('href');
const $clickedEl = $(e.target);
const path = $('.tree-item-file-name a', this).attr('href');
if (!$clickedEl.is('a') && !$clickedEl.is('.str-truncated')) {
if (e.metaKey || e.which === 2) {
e.preventDefault();
......@@ -26,11 +25,10 @@ export default class TreeView {
}
initKeyNav() {
var li, liSelected;
li = $('tr.tree-item');
liSelected = null;
const li = $('tr.tree-item');
let liSelected = null;
return $('body').keydown(e => {
var next, path;
let next, path;
if ($('input:focus').length > 0 && (e.which === 38 || e.which === 40)) {
return false;
}
......
---
title: Remove var from tree.js
merge_request: 20103
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