Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions public/css/timeline.less
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,8 @@
transform: rotate(225deg);
}
}
}

&:hover {
.rotation-info {
&.entry-is-hovered {
z-index: 1;
display: flex;
}
Expand Down
34 changes: 21 additions & 13 deletions public/js/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
}

class NotificationsSchedule extends Icinga.EventListener {
activeTimeout = null;
constructor(icinga)
{
super(icinga);
Expand Down Expand Up @@ -96,18 +97,21 @@
relatedEntries.forEach(element => element.classList.add('highlighted'));

if (tooltip) {
const grid = event.currentTarget.parentElement.previousSibling;
requestAnimationFrame(() => {
const tooltipRect = tooltip.getBoundingClientRect();
const gridRect = grid.getBoundingClientRect();
if (tooltipRect.right > gridRect.right) {
tooltip.classList.add('is-left');
}

if (tooltipRect.top < gridRect.top) {
tooltip.classList.add('is-bottom');
}
});
this.activeTimeout = setTimeout(() => {
tooltip.classList.add('entry-is-hovered');
const grid = event.currentTarget.parentElement.previousSibling;
requestAnimationFrame(() => {
const tooltipRect = tooltip.getBoundingClientRect();
const gridRect = grid.getBoundingClientRect();
if (tooltipRect.right > gridRect.right) {
tooltip.classList.add('is-left');
}

if (tooltipRect.top < gridRect.top) {
tooltip.classList.add('is-bottom');
}
});
}, 250);
}
}

Expand All @@ -123,7 +127,11 @@
relatedEntries.forEach(element => element.classList.remove('highlighted'));

if (tooltip) {
tooltip.classList.remove('is-left', 'is-bottom');
if (this.activeTimeout) {
clearTimeout(this.activeTimeout);
}

tooltip.classList.remove('is-left', 'is-bottom', 'entry-is-hovered');
}
}

Expand Down
Loading