Use Standard JS for JS code
This commit is contained in:
parent
93cb70455d
commit
4d4a58361b
@ -1,14 +1,9 @@
|
|||||||
function autosize(){
|
function autosize () {
|
||||||
const el = this;
|
const el = this
|
||||||
el.style.height = 'auto';
|
el.style.height = 'auto'
|
||||||
el.style.height = (el.scrollHeight ) + 'px';
|
el.style.height = `${el.scrollHeight}px`
|
||||||
}
|
}
|
||||||
|
|
||||||
const articleContent = document.querySelector('#content');
|
const articleContent = document.querySelector('#content')
|
||||||
let offset = 0;
|
autosize.bind(articleContent)()
|
||||||
let style = window.getComputedStyle(articleContent, null);
|
articleContent.addEventListener('keyup', autosize)
|
||||||
|
|
||||||
offset += parseInt(style['paddingTop']) + parseInt(style['paddingBottom']);
|
|
||||||
autosize.bind(articleContent)();
|
|
||||||
articleContent.addEventListener('keyup', autosize);
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user