1.5.8
Fix popups
This commit is contained in:
+3
-3
@@ -1348,10 +1348,10 @@ ${isPro && (activeProfile === 'custom' || activeCols['air']) && html`<button cla
|
||||
<span>${localHHMM}</span>
|
||||
${(() => {
|
||||
const rowEvents = getCellTagEvents(selectedDayEvents, r);
|
||||
return rowEvents.map(ev => html`
|
||||
return rowEvents.map((ev, idx) => html`
|
||||
<span key=${ev.id} class="event-cell-tag"
|
||||
onClick=${(e) => handleEventTagClick(rowEvents, e)}
|
||||
onMouseEnter=${(e) => handleEventTagEnter(rowEvents, e)}
|
||||
onClick=${(e) => handleEventTagClick(rowEvents, idx, e)}
|
||||
onMouseEnter=${(e) => handleEventTagEnter(rowEvents, idx, e)}
|
||||
onMouseLeave=${handleEventTagLeave}
|
||||
role="button" tabIndex="0" aria-label=${ev.title}
|
||||
>${ev.emoji}</span>
|
||||
|
||||
@@ -149,9 +149,10 @@ export function useColumnPopup() {
|
||||
}, [eventTagPopup, evSlideTo]);
|
||||
|
||||
// --- Event tag popup handlers ----------------------------------------
|
||||
const openEventTagPopup = (events, spanEl) => {
|
||||
const openEventTagPopup = (events, spanEl, startIndex = 0) => {
|
||||
clearInterval(evSlideTimerRef.current);
|
||||
setEvSlideIndex(0);
|
||||
setEvSlideIndex(startIndex);
|
||||
prevSlideIndexRef.current = startIndex;
|
||||
setEvTransition(null);
|
||||
setEventTagPopup({ events, ...calcEventPopupPos(spanEl) });
|
||||
};
|
||||
@@ -166,7 +167,7 @@ export function useColumnPopup() {
|
||||
};
|
||||
|
||||
// rowEvents = all events for that row (passed in from app.js)
|
||||
const handleEventTagClick = (rowEvents, e) => {
|
||||
const handleEventTagClick = (rowEvents, startIndex, e) => {
|
||||
e.stopPropagation();
|
||||
clearTimeout(evHoverTimerRef.current);
|
||||
clearTimeout(evCloseTimerRef.current);
|
||||
@@ -174,14 +175,14 @@ export function useColumnPopup() {
|
||||
if (eventTagPopup && JSON.stringify(eventTagPopup.events.map(ev => ev.id)) === JSON.stringify(rowEvents.map(ev => ev.id))) {
|
||||
closeEventTagPopup(); return;
|
||||
}
|
||||
openEventTagPopup(rowEvents, e.currentTarget);
|
||||
openEventTagPopup(rowEvents, e.currentTarget, startIndex);
|
||||
};
|
||||
|
||||
const handleEventTagEnter = (rowEvents, e) => {
|
||||
const handleEventTagEnter = (rowEvents, startIndex, e) => {
|
||||
clearTimeout(evHoverTimerRef.current);
|
||||
clearTimeout(evCloseTimerRef.current);
|
||||
const spanEl = e.currentTarget;
|
||||
evHoverTimerRef.current = setTimeout(() => openEventTagPopup(rowEvents, spanEl), 700);
|
||||
evHoverTimerRef.current = setTimeout(() => openEventTagPopup(rowEvents, spanEl, startIndex), 700);
|
||||
};
|
||||
|
||||
const handleEventTagLeave = () => clearTimeout(evHoverTimerRef.current);
|
||||
|
||||
Reference in New Issue
Block a user