summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/blob
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r--app/assets/javascripts/blob/components/blob_edit_content.vue9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/assets/javascripts/blob/components/blob_edit_content.vue b/app/assets/javascripts/blob/components/blob_edit_content.vue
index 9a30ed93330..056b4ea4aa8 100644
--- a/app/assets/javascripts/blob/components/blob_edit_content.vue
+++ b/app/assets/javascripts/blob/components/blob_edit_content.vue
@@ -1,5 +1,6 @@
<script>
import { initEditorLite } from '~/blob/utils';
+import { debounce } from 'lodash';
export default {
props: {
@@ -32,16 +33,14 @@ export default {
});
},
methods: {
- triggerFileChange() {
+ triggerFileChange: debounce(function debouncedFileChange() {
this.$emit('input', this.editor.getValue());
- },
+ }, 250),
},
};
</script>
<template>
<div class="file-content code">
- <pre id="editor" ref="editor" data-editor-loading @focusout="triggerFileChange">{{
- value
- }}</pre>
+ <pre id="editor" ref="editor" data-editor-loading @keyup="triggerFileChange">{{ value }}</pre>
</div>
</template>