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