Plume/static/js/autoExpand.js

8 lines
306 B
JavaScript
Raw Normal View History

2018-10-30 18:16:24 +01:00
const articleContent = document.querySelector('#plume-editor')
const offset = articleContent.offsetHeight - articleContent.clientHeight
2018-10-30 18:16:24 +01:00
articleContent.addEventListener('keydown', () => {
articleContent.style.height = 'auto'
articleContent.style.height = `${articleContent.scrollHeight - offset}px`
})