mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-30 05:50:53 +00:00
Use Standard JS for JS code
This commit is contained in:
parent
93cb70455d
commit
4d4a58361b
1 changed files with 7 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue