autoheight support

This commit is contained in:
Amberstone 2024-12-11 02:22:16 +09:00
parent 27f89e3663
commit 5c71bdb6fe
Signed by: amber
GPG key ID: 094B0E55F98D8BF1

View file

@ -53,7 +53,7 @@ echo $option_hidden;
<div class="ui-write-box ui-text-area<?= $w == 'u' ? " update" : ""; ?>">
<a href="#" class="write_open ui-btn point">+</a>
<p>
<textarea name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>" style="resize: vertical !important; transition: none; height: 1em;"></textarea>
<textarea name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>" style="resize: vertical !important; transition: none; min-height: 1em;"></textarea>
<button type="submit" id="btn_submit" class="ui-btn" accesskey='s'>입력</button><?php if ($w == 'u') { ?><a
href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn etc">뒤로</a><?php } ?>
<?php if (!$is_member) { ?>
@ -87,4 +87,9 @@ echo $option_hidden;
function fwrite_submit(f) {
return true;
}
document.getElementById("content").addEventListener("input", function() {
this.style.height = 'auto';
this.style.height = this.scrollHeight + 'px';
});
</script>