diff options
author | n-peugnet <n.peugnet@free.fr> | 2019-11-07 00:32:15 +0100 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2019-11-07 00:32:15 +0100 |
commit | 19803db70f2a5a4162d1be2ca0f72eb08e25d544 (patch) | |
tree | b79100f0017d3f6ca5c1b329a6e63c857f0d7640 | |
parent | 711a2d7a0b7d9a6c1b644d56916c92f55b90677d (diff) | |
download | wcms-19803db70f2a5a4162d1be2ca0f72eb08e25d544.tar.gz wcms-19803db70f2a5a4162d1be2ca0f72eb08e25d544.zip |
feat: live title edit
update the title of the window in sync with the input box
-rw-r--r-- | src/edit.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/edit.js b/src/edit.js index 910c229..c1018d7 100644 --- a/src/edit.js +++ b/src/edit.js @@ -92,6 +92,10 @@ window.addEventListener('load', () => { fontSizeInput.addEventListener('change', fontSizeChangeHandler); fontSizeInput.dispatchEvent(new Event('change')); + document.getElementById('title').addEventListener('input', e => { + pagetitle = e.target.value; + }); + window.onkeydown = keyboardHandler; window.onbeforeunload = confirmExit; }); |