Commit f03ce99f authored by Phil Hughes's avatar Phil Hughes

Merge branch 'winh-iife-project_find_file' into 'master'

Remove IIFEs from project_find_file.js

Closes #34623

See merge request gitlab-org/gitlab!21855
parents d4fd6eb5 13b41465
......@@ -55,26 +55,21 @@ export default class ProjectFindFile {
initEvent() {
this.inputElement.off('keyup');
this.inputElement.on(
'keyup',
(function(_this) {
return function(event) {
const target = $(event.target);
const value = target.val();
const ref = target.data('oldValue');
const oldValue = ref != null ? ref : '';
if (value !== oldValue) {
target.data('oldValue', value);
_this.findFile();
return _this.element
.find('tr.tree-item')
.eq(0)
.addClass('selected')
.focus();
}
};
})(this),
);
this.inputElement.on('keyup', event => {
const target = $(event.target);
const value = target.val();
const ref = target.data('oldValue');
const oldValue = ref != null ? ref : '';
if (value !== oldValue) {
target.data('oldValue', value);
this.findFile();
return this.element
.find('tr.tree-item')
.eq(0)
.addClass('selected')
.focus();
}
});
}
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