Use Standard JS for JS code

This commit is contained in:
Bat 2018-09-01 21:42:53 +01:00
parent 93cb70455d
commit 4d4a58361b

View File

@ -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)