diff --git a/css/fvtt-hamalron.css b/css/fvtt-hamalron.css index c025c5c..4fc20e2 100644 --- a/css/fvtt-hamalron.css +++ b/css/fvtt-hamalron.css @@ -3159,6 +3159,9 @@ i.fvtt-hamalron { padding: 4px 8px; border-bottom: 1px solid #444; flex-wrap: wrap; + position: relative; + z-index: 1; + pointer-events: auto; } .hamalron-chat-btn { display: flex; @@ -3172,6 +3175,9 @@ i.fvtt-hamalron { cursor: pointer; font-size: 11px; white-space: nowrap; + pointer-events: auto; + position: relative; + z-index: 1; } .hamalron-chat-btn:hover { background: #3a3a6a; diff --git a/fvtt-hamalron.mjs b/fvtt-hamalron.mjs index 1b79f94..f49b587 100644 --- a/fvtt-hamalron.mjs +++ b/fvtt-hamalron.mjs @@ -241,12 +241,16 @@ function addChatTools() { await HamalronTirageTarot.promptEpreuve(actor) }) - // Insérer en haut de #chat (avant le sidebar-tab-core) - const firstChild = chatEl.firstElementChild - if (firstChild) { - chatEl.insertBefore(tools, firstChild) + // Insérer dans .sidebar-tab-core avant .sidebar-tab-scroll + const core = chatEl.querySelector(".sidebar-tab-core") + const scroll = core?.querySelector(".sidebar-tab-scroll") + if (core && scroll) { + core.insertBefore(tools, scroll) } else { - chatEl.appendChild(tools) + // Fallback: en haut de #chat + const firstChild = chatEl.firstElementChild + if (firstChild) chatEl.insertBefore(tools, firstChild) + else chatEl.appendChild(tools) } } diff --git a/styles/chat.less b/styles/chat.less index b291a25..47e109b 100644 --- a/styles/chat.less +++ b/styles/chat.less @@ -968,6 +968,9 @@ padding: 4px 8px; border-bottom: 1px solid #444; flex-wrap: wrap; + position: relative; + z-index: 1; + pointer-events: auto; } .hamalron-chat-btn { @@ -982,6 +985,9 @@ cursor: pointer; font-size: 11px; white-space: nowrap; + pointer-events: auto; + position: relative; + z-index: 1; &:hover { background: #3a3a6a;