diff --git a/lib/css/chat-layout-pc.css b/lib/css/chat-layout-pc.css index e2ab8d59..ca960477 100644 --- a/lib/css/chat-layout-pc.css +++ b/lib/css/chat-layout-pc.css @@ -936,12 +936,23 @@ body { left: 5em; right: auto; bottom: 8em; + max-height: 40vh; + min-height: 12rem; + min-width: 42vw; + + > .comm-area { + height: calc(100% - (0.5rem * 2) - (3rem + ((2rem * 2) + 0.1rem))); + margin-top: 0.5rem; + margin-bottom: 0.5rem; + + textarea { + height: 100%; + overflow-y: auto; + } + } } #rewrite-form textarea { - width: 40vw; - max-width: 90vw; - max-height: 80vh; - margin-top: .1rem; + margin: 0; } #rewrite-name-form { top: auto; diff --git a/lib/html/room.html b/lib/html/room.html index 6f7d6719..64af440e 100644 --- a/lib/html/room.html +++ b/lib/html/room.html @@ -246,7 +246,7 @@

発言名変更

発言編集

- +
diff --git a/lib/js/ui.js b/lib/js/ui.js index 7d9d8dc6..985c7365 100644 --- a/lib/js/ui.js +++ b/lib/js/ui.js @@ -449,8 +449,33 @@ function rewriteOpen(num){ .replace(/</g, '<') .replace(/>/g, '>') obj.value = setValue; - autosizeUpdate(obj); obj.focus(); + + { + const sourceMessageNode = document.getElementById(`line-${num}-comm`); + + if (sourceMessageNode != null) { + const rewriteForm = document.getElementById('rewrite-form'); + const tabGroupNode = sourceMessageNode.closest('.tab-group'); + const isMain = tabGroupNode.classList.contains('main'); + + const rect = sourceMessageNode.getBoundingClientRect(); + + const x = isMain ? rect.left : rect.right - rewriteForm.getBoundingClientRect().width; + const y = Math.min(rect.bottom + 15, tabGroupNode.getBoundingClientRect().bottom); + + const m = rewriteForm.style.inset.match(/^[\d.]+px\s+(\S+)\s+(\S+)\s+[\d.]+px$/); + + if (m != null) { + rewriteForm.style.inset = `${y}px ${m[1]} ${m[2]} ${x}px`; + } else { + rewriteForm.style.left = `${x}px`; + rewriteForm.style.right = 'auto'; + rewriteForm.style.top = `${y}px`; + rewriteForm.style.bottom = 'auto'; + } + } + } } function rewriteNameOpen(num,name){ boxOpen('rewrite-name-form');