Plume/static/js/autoExpand.js

10 lines
255 B
JavaScript
Raw Normal View History

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