diff options
author | Allan Wang <me@allanwang.ca> | 2020-10-03 21:22:24 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2020-10-03 21:22:24 -0700 |
commit | ad9fdf9f6718918e9daf5c0afb378f0bc4e47283 (patch) | |
tree | 36e67d32f5b61656257cf476e815292508ff2596 /app/src/web/ts | |
parent | c86207a3baba6a1c2b4ebab611f0ae552d2607cd (diff) | |
download | frost-ad9fdf9f6718918e9daf5c0afb378f0bc4e47283.tar.gz frost-ad9fdf9f6718918e9daf5c0afb378f0bc4e47283.tar.bz2 frost-ad9fdf9f6718918e9daf5c0afb378f0bc4e47283.zip |
Force refresh on settings change and use shared class tag
Diffstat (limited to 'app/src/web/ts')
-rw-r--r-- | app/src/web/ts/auto_resize_textarea.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/web/ts/auto_resize_textarea.ts b/app/src/web/ts/auto_resize_textarea.ts index e170d14e..1f1b3613 100644 --- a/app/src/web/ts/auto_resize_textarea.ts +++ b/app/src/web/ts/auto_resize_textarea.ts @@ -1,6 +1,7 @@ // Credits to https://codepen.io/tomhodgins/pen/KgazaE (function () { - const textareas = <NodeListOf<HTMLTextAreaElement>>document.querySelectorAll('textarea:not(.frostAutoExpand)'); + const classTag = 'frostAutoExpand'; + const textareas = <NodeListOf<HTMLTextAreaElement>>document.querySelectorAll(`textarea:not(.${classTag})`); const dataAttribute = 'data-frost-minHeight'; @@ -18,7 +19,7 @@ textareas.forEach(_frostAutoExpand); } textareas.forEach(el => { - el.classList.add('frostAutoExpand') + el.classList.add(classTag) const __frostAutoExpand = () => { _frostAutoExpand(el) }; |