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',
(function(_this) {
return function(event) {
const target = $(event.target); const target = $(event.target);
const value = target.val(); const value = target.val();
const ref = target.data('oldValue'); const ref = target.data('oldValue');
const oldValue = ref != null ? ref : ''; const oldValue = ref != null ? ref : '';
if (value !== oldValue) { if (value !== oldValue) {
target.data('oldValue', value); target.data('oldValue', value);
_this.findFile(); this.findFile();
return _this.element return this.element
.find('tr.tree-item') .find('tr.tree-item')
.eq(0) .eq(0)
.addClass('selected') .addClass('selected')
.focus(); .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