Skip to content

Commit 55bdf4b

Browse files
committed
remove unnecessary if and trigger
1 parent 51d2305 commit 55bdf4b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

web_src/js/features/repo-editor.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export function initRepoEditor() {
9292
});
9393

9494
const $editFilename = $('#file-name');
95-
$editFilename.on('keyup', function (e) {
95+
$editFilename.on('input', function (e) {
9696
const $section = $('.breadcrumb span.section');
9797
const $divider = $('.breadcrumb div.divider');
9898
let value;
@@ -106,7 +106,7 @@ export function initRepoEditor() {
106106
$divider.last().remove();
107107
}
108108
parts = $(this).val().split('/');
109-
if (e.keyCode === 191 || parts.length > 1) {
109+
if (parts.length > 1) {
110110
for (let i = 0; i < parts.length; ++i) {
111111
value = parts[i];
112112
if (i < parts.length - 1) {
@@ -131,8 +131,7 @@ export function initRepoEditor() {
131131
});
132132
if ($(this).val()) parts.push($(this).val());
133133
$('#tree_path').val(parts.join('/'));
134-
}).trigger('keyup');
135-
134+
})
136135
const $editArea = $('.repository.editor textarea#edit_area');
137136
if (!$editArea.length) return;
138137

0 commit comments

Comments
 (0)