]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/page-editor.js
Adjusted global search preview for dark mode
[bookstack] / resources / js / components / page-editor.js
index ce123e987b055db94769f7326a8fdf63f841342b..14f6b5b3e1ac87574a24aa9937d764fdb2fe22aa 100644 (file)
@@ -1,5 +1,6 @@
 import * as Dates from "../services/dates";
 import {onSelect} from "../services/dom";
+import {debounce} from "../services/util";
 
 /**
  * Page Editor
@@ -69,7 +70,8 @@ class PageEditor {
         });
 
         // Changelog controls
-        this.changelogInput.addEventListener('change', this.updateChangelogDisplay.bind(this));
+        const updateChangelogDebounced = debounce(this.updateChangelogDisplay.bind(this), 300, false);
+        this.changelogInput.addEventListener('input', updateChangelogDebounced);
 
         // Draft Controls
         onSelect(this.saveDraftButton, this.saveDraft.bind(this));