diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-23 12:07:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-23 12:07:42 +0300 |
commit | b8bb2148c282f5ebaf5cd3c83d905285902a1446 (patch) | |
tree | 9c104ecb570b5df83ef2e01fa26d0a56355c1d05 /app/assets/javascripts/project_find_file.js | |
parent | 64fbcb2e57083569f2fda885784c20b6bc2c38f4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/project_find_file.js')
-rw-r--r-- | app/assets/javascripts/project_find_file.js | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/app/assets/javascripts/project_find_file.js b/app/assets/javascripts/project_find_file.js index d6cdd37a2c3..a31034361a8 100644 --- a/app/assets/javascripts/project_find_file.js +++ b/app/assets/javascripts/project_find_file.js @@ -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() { |