diff --git a/tools/server/public_simplechat/simplechat.css b/tools/server/public_simplechat/simplechat.css index ed94361ef0..195c01a016 100644 --- a/tools/server/public_simplechat/simplechat.css +++ b/tools/server/public_simplechat/simplechat.css @@ -93,7 +93,12 @@ max-height: 20vmin; } #popover-chatmsg { - position:absolute; + position:fixed; + position-area: span-bottom center; + /* + inset-block-end: anchor(end)-; + inset-inline-end: anchor(self-start); + */ background-color: transparent; padding: 0; border-width: 0; diff --git a/tools/server/public_simplechat/simplechat.js b/tools/server/public_simplechat/simplechat.js index 74d675eba7..42eb68b600 100644 --- a/tools/server/public_simplechat/simplechat.js +++ b/tools/server/public_simplechat/simplechat.js @@ -1211,17 +1211,16 @@ class MultiChatUI { secMain.classList.add(`role-${msg.ns.role}`) secMain.classList.add('chat-message') secMain.addEventListener('mouseenter', (ev)=>{ - let trect = secMain.getBoundingClientRect(); - let prect = this.elPopoverChatMsg.getBoundingClientRect(); - this.elPopoverChatMsg.style.top = `${trect.top+2}px` - this.elPopoverChatMsg.style.left = `${((trect.width)*0.9) - prect.width}px` + console.log(`DBUG:MCUI:ChatMessageMEnter:${msg.uniqId}`) + if (this.uniqIdChatMsgPO != msg.uniqId) { + this.elPopoverChatMsg.hidePopover() + } this.uniqIdChatMsgPO = msg.uniqId // @ts-ignore this.elPopoverChatMsg.showPopover({source: secMain}) }) secMain.addEventListener('mouseleave', (ev)=>{ - this.elPopoverChatMsg.hidePopover() - //this.uniqIdChatMsgPO = -1 + console.log(`DBUG:MCUI:ChatMessageMLeave:${msg.uniqId}`) }) elParent?.append(secMain) this.elLastChatMessage = secMain;