X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/c4839c783ae0ac678c5a3a3eb7f47ac360793816..refs/pull/5663/head:/resources/js/components/page-editor.js diff --git a/resources/js/components/page-editor.js b/resources/js/components/page-editor.js index 81378e944..2a155f37f 100644 --- a/resources/js/components/page-editor.js +++ b/resources/js/components/page-editor.js @@ -75,7 +75,12 @@ export class PageEditor extends Component { // Changelog controls const updateChangelogDebounced = debounce(this.updateChangelogDisplay.bind(this), 300, false); - this.changelogInput.addEventListener('input', updateChangelogDebounced); + this.changelogInput.addEventListener('input', () => { + const count = this.changelogInput.value.length; + const counterEl = document.getElementById('changelog-count'); + if (counterEl) counterEl.innerText = `${count} / 250`; + updateChangelogDebounced(); + }); // Draft Controls onSelect(this.saveDraftButton, this.saveDraft.bind(this));