diff --git a/static/js/autoExpand.js b/static/js/autoExpand.js index 33fb32e..fbc25e8 100644 --- a/static/js/autoExpand.js +++ b/static/js/autoExpand.js @@ -1,14 +1,9 @@ -function autosize(){ - const el = this; - el.style.height = 'auto'; - el.style.height = (el.scrollHeight ) + 'px'; +function autosize () { + const el = this + el.style.height = 'auto' + el.style.height = `${el.scrollHeight}px` } -const articleContent = document.querySelector('#content'); -let offset = 0; -let style = window.getComputedStyle(articleContent, null); - -offset += parseInt(style['paddingTop']) + parseInt(style['paddingBottom']); -autosize.bind(articleContent)(); -articleContent.addEventListener('keyup', autosize); - +const articleContent = document.querySelector('#content') +autosize.bind(articleContent)() +articleContent.addEventListener('keyup', autosize)