1.5.8
Fix popups
This commit is contained in:
@@ -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