autoexpand generated textareas too
parent
835c5f810d
commit
965a484595
|
@ -146,6 +146,14 @@ function register_new_elements(e) {
|
|||
for (const element of onclick) {
|
||||
element.onclick = () => {execute(element, 'onclick')};
|
||||
}
|
||||
|
||||
const textareas = e.getElementsByTagName('textarea')
|
||||
for (const element of textareas) {
|
||||
autoExpand(element)
|
||||
element.addEventListener('input', () => {
|
||||
autoExpand(element)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
register_new_elements(document);
|
||||
|
|
|
@ -145,14 +145,6 @@ function autoExpand(field) {
|
|||
window.scrollTo(xpos,ypos);
|
||||
};
|
||||
|
||||
const textareas = document.getElementsByTagName('textarea')
|
||||
for (const element of textareas) {
|
||||
autoExpand(element)
|
||||
element.addEventListener('input', () => {
|
||||
autoExpand(element)
|
||||
});
|
||||
}
|
||||
|
||||
function smoothScrollTop()
|
||||
{
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
|
|
Loading…
Reference in New Issue