1
0

Fix EGG tooltip css/script
All checks were successful
Build Docker and Deploy / Build Docker (push) Successful in 1m38s
Build Docker and Deploy / Deploy to Server (push) Successful in 20s

This commit is contained in:
Mike Schwörer 2025-07-18 23:52:32 +02:00
parent 6f0a66f880
commit 766087357b
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
2 changed files with 40 additions and 39 deletions

View File

@ -2,16 +2,16 @@
var ExtendedGitGraph2;
(function (ExtendedGitGraph2) {
function initHover() {
const allsvgtips = Array.from(document.getElementsByClassName("svg-tip"));
if (allsvgtips.length == 0)
return;
const masterTip = allsvgtips[0];
for (const container of document.querySelectorAll('.extGitGraphContainer')) {
const masterTip = container.querySelector('.svg-tip');
if (masterTip === null)
continue;
masterTip.style.opacity = '1';
masterTip.style.display = 'none';
const masterTipHeader = masterTip.getElementsByTagName('strong')[0];
const masterTipContent = masterTip.getElementsByTagName('span')[0];
const masterTipExtra = masterTip.getElementsByTagName('span')[0];
const rects = Array.from(document.getElementsByClassName("egg_rect"));
const masterTipHeader = masterTip.querySelector('.caption');
const masterTipContent = masterTip.querySelector('.date');
const masterTipExtra = masterTip.querySelector('.extra');
const rects = Array.from(container.querySelectorAll(".egg_rect"));
for (let rect of rects) {
rect.addEventListener("mouseenter", event => {
const target = event.target;
@ -27,7 +27,7 @@ var ExtendedGitGraph2;
for (const attr of extraAttr) {
try {
let obj = JSON.parse(attr.replace(/'/g, '"'));
extraHTML += `<span class="extra-attr">[${obj.source}] ${obj.repo_name}:</span><strong>${obj.count}</strong>\n`;
extraHTML += `<span class="extra-attr">${obj.repo_name}:</span><strong>${obj.count}</strong>\n`;
}
catch (e) {
console.error('Error parsing extra attribute:', attr, e);
@ -44,6 +44,7 @@ var ExtendedGitGraph2;
rect.addEventListener("mouseleave", _ => masterTip.style.display = 'none');
}
}
}
ExtendedGitGraph2.initHover = initHover;
})(ExtendedGitGraph2 || (ExtendedGitGraph2 = {}));
window.onload = () => { ExtendedGitGraph2.initHover(); };

View File

@ -291,7 +291,7 @@ class SingleYearRenderer implements IOutputGenerator
$html .= '</g>' . "\n";
$html .= '</svg>' . "\n";
$html .= '<div class="svg-tip n"">' . "\n";
$html .= '<strong>&nbsp;</strong><span>&nbsp;</span><div style="display: grid; grid-template-columns: auto 1fr; grid-column-gap: 0.5rem; margin-top: 1rem; text-align: right;"></div>' . "\n";
$html .= '<strong class="caption">&nbsp;</strong><span class="date">&nbsp;</span><div class="extra" style="display: grid; grid-template-columns: auto 1fr; grid-column-gap: 0.5rem; margin-top: 1rem; text-align: right;"></div>' . "\n";
$html .= '</div>' . "\n";
$html .= '<div class="egg_footer">' . "\n";
$html .= '<a href="https://www.mikescher.com/programs/view/ExtendedGitGraph">extendedGitGraph</a>' . "\n";