Commit 13b41465 authored by Inactive Account's avatar Inactive Account Committed by Phil Hughes

Remove IIFEs from project_find_file.js

parent d4fd6eb5
...@@ -55,26 +55,21 @@ export default class ProjectFindFile { ...@@ -55,26 +55,21 @@ export default class ProjectFindFile {
initEvent() { initEvent() {
this.inputElement.off('keyup'); this.inputElement.off('keyup');
this.inputElement.on( this.inputElement.on('keyup', event => {
'keyup', const target = $(event.target);
(function(_this) { const value = target.val();
return function(event) { const ref = target.data('oldValue');
const target = $(event.target); const oldValue = ref != null ? ref : '';
const value = target.val(); if (value !== oldValue) {
const ref = target.data('oldValue'); target.data('oldValue', value);
const oldValue = ref != null ? ref : ''; this.findFile();
if (value !== oldValue) { return this.element
target.data('oldValue', value); .find('tr.tree-item')
_this.findFile(); .eq(0)
return _this.element .addClass('selected')
.find('tr.tree-item') .focus();
.eq(0) }
.addClass('selected') });
.focus();
}
};
})(this),
);
} }
findFile() { findFile() {
......
---
title: refactor javascript to remove Immediately Invoked Function Expression from
project file search
merge_request: 19192
author: Brian Luckenbill
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