Plume/static/js/autoExpand.js

10 lines
255 B
JavaScript
Raw Normal View History

2018-09-01 22:42:53 +02:00
function autosize () {
const el = this
el.style.height = 'auto'
el.style.height = `${el.scrollHeight}px`
}
2018-09-01 22:42:53 +02:00
const articleContent = document.querySelector('#content')
autosize.bind(articleContent)()
articleContent.addEventListener('keyup', autosize)