summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/codeeditor.js
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-05-10 23:50:58 +0800
committerGitHub <noreply@github.com>2023-05-10 15:50:58 +0000
commit23ae939ef3ef03848038372de21490725855b5f9 (patch)
treefaaf98dea14e8ac6fd0e60df67f0f94c8bee97d7 /web_src/js/features/codeeditor.js
parent54f399c4df7d3470fff570afc145cbec3f0dcd40 (diff)
downloadgitea-23ae939ef3ef03848038372de21490725855b5f9.tar.gz
gitea-23ae939ef3ef03848038372de21490725855b5f9.zip
Improve "goto issue by number" button (#24577)
Follow #24479 ![image](https://user-images.githubusercontent.com/2114189/236694114-c5cb42ff-456d-465a-bcb9-89ed5959d346.png) ![image](https://user-images.githubusercontent.com/2114189/236694119-052e689c-6264-4468-9ab3-0e5c97521bec.png) ![image](https://user-images.githubusercontent.com/2114189/236694139-f8940765-42ce-462d-b49e-50a416cc6f85.png) ![image](https://user-images.githubusercontent.com/2114189/236694154-6d8a000c-9ef3-4d07-af1c-59b0cf8f4d33.png) ![image](https://user-images.githubusercontent.com/2114189/236694166-3bc3e585-7955-44aa-af34-b33ae91e132f.png) --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src/js/features/codeeditor.js')
-rw-r--r--web_src/js/features/codeeditor.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/features/codeeditor.js b/web_src/js/features/codeeditor.js
index 3a925e08c1..76eeaa9898 100644
--- a/web_src/js/features/codeeditor.js
+++ b/web_src/js/features/codeeditor.js
@@ -1,5 +1,5 @@
import {basename, extname, isObject, isDarkTheme} from '../utils.js';
-import {debounce} from 'throttle-debounce';
+import {onInputDebounce} from '../utils/dom.js';
const languagesByFilename = {};
const languagesByExt = {};
@@ -164,7 +164,7 @@ export async function createCodeEditor(textarea, filenameInput) {
...getEditorConfigOptions(editorConfig),
});
- filenameInput.addEventListener('input', debounce(500, () => {
+ filenameInput.addEventListener('input', onInputDebounce(() => {
const filename = filenameInput.value;
const previewable = previewableExts.has(extname(filename));
togglePreviewDisplay(previewable);