From abe85cb5d32200f5dc9d131f57982fa554641870 Mon Sep 17 00:00:00 2001 From: "fefe.clochette" Date: Wed, 7 Jan 2026 10:06:56 +0100 Subject: [PATCH] menu open --- modules/family-calendar/family-calendar.css | 10 +++---- modules/family-calendar/family-calendar.js | 26 ++++++++++++++++--- .../includes/api/events-debug.log | 1 + 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/modules/family-calendar/family-calendar.css b/modules/family-calendar/family-calendar.css index 3307dfe..d6cf2d9 100644 --- a/modules/family-calendar/family-calendar.css +++ b/modules/family-calendar/family-calendar.css @@ -57,7 +57,6 @@ #planningTable .col-total { width: 50px; max-width: 50px; - white-space: nowrap; } /* Sous-colonnes Alex/Laia */ @@ -86,8 +85,10 @@ /* Header sticky */ #planningHeaderTable { - width: 100%; - border-collapse: collapse; + position: sticky; + top: 0; + z-index: 5; + background: #f0f4f8; } /* Empêcher le header de bouger/contracter */ #planningHeaderTable th { @@ -109,7 +110,6 @@ /* Ligne 1 */ #planningTable thead tr:nth-child(1) th { - position: sticky; top: 0; z-index: 3; background: #f0f4f8; @@ -117,7 +117,6 @@ /* Ligne 2 */ #planningTable thead tr:nth-child(2) th { - position: sticky; top: 24px; /* hauteur de la 1ère ligne */ z-index: 3; background: #f0f4f8; @@ -125,7 +124,6 @@ /* Ligne 3 */ #planningTable thead tr:nth-child(3) th { - position: sticky; top: 48px; /* 1ère + 2e ligne (22 + 22) */ z-index: 3; background: #f0f4f8; diff --git a/modules/family-calendar/family-calendar.js b/modules/family-calendar/family-calendar.js index 42404b5..2a84756 100644 --- a/modules/family-calendar/family-calendar.js +++ b/modules/family-calendar/family-calendar.js @@ -920,10 +920,20 @@ document.addEventListener("DOMContentLoaded", () => { } positionAndShowMenu(e) { + const wrapper = document.getElementById("planningTable-wrapper"); + const rect = wrapper.getBoundingClientRect(); + this.selectionMenu.style.display = "block"; - this.selectionMenu.style.left = `${e.pageX + 5}px`; - this.selectionMenu.style.top = `${e.pageY + 5}px`; + + // Position relative au wrapper, pas à la page + this.selectionMenu.style.left = `${e.clientX - rect.left + 5}px`; + this.selectionMenu.style.top = `${e.clientY - rect.top + 5}px`; + + // Empêcher la fermeture immédiate par handleClickOutsideMenu this.menuJustOpened = true; + setTimeout(() => { + this.menuJustOpened = false; + }, 0); } async handleMenuClick(e) { @@ -2150,10 +2160,18 @@ document.addEventListener("DOMContentLoaded", () => { positionAndShowMonthMenu(e) { if (!this.monthSelectionMenu) return; + const wrapper = + document.querySelector(".fc-month-calendar-wrapper") || document.body; + const rect = wrapper.getBoundingClientRect(); + this.monthSelectionMenu.style.display = "block"; - this.monthSelectionMenu.style.left = `${e.pageX + 5}px`; - this.monthSelectionMenu.style.top = `${e.pageY + 5}px`; + this.monthSelectionMenu.style.left = `${e.clientX - rect.left + 5}px`; + this.monthSelectionMenu.style.top = `${e.clientY - rect.top + 5}px`; + this.menuJustOpened = true; + setTimeout(() => { + this.menuJustOpened = false; + }, 0); } async handleMonthMenuClick(e) { diff --git a/modules/family-calendar/includes/api/events-debug.log b/modules/family-calendar/includes/api/events-debug.log index e00b743..b80b64e 100644 --- a/modules/family-calendar/includes/api/events-debug.log +++ b/modules/family-calendar/includes/api/events-debug.log @@ -15,3 +15,4 @@ [2026-01-06T15:11:57+01:00] RAW INPUT: [{"date":"2025-09-23","type":"PEP_SICK","duration":1}] [2026-01-06T15:17:03+01:00] RAW INPUT: [{"date":"2025-09-10","type":"CENTRE","duration":1}] [2026-01-06T15:26:35+01:00] RAW INPUT: [{"date":"2025-10-06","type":"PEP_SICK","duration":1},{"date":"2025-10-07","type":"PEP_SICK","duration":1},{"date":"2025-10-08","type":"PEP_SICK","duration":1}] +[2026-01-07T10:04:23+01:00] RAW INPUT: [{"date":"2025-09-19","type":"OFF_CAROLE","person":"Carole","duration":1}]