Fix EGG tooltip css/script
This commit is contained in:
parent
6f0a66f880
commit
766087357b
@ -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(); };
|
||||
|
2
www/extern/egg/OutputGenerator.php
vendored
2
www/extern/egg/OutputGenerator.php
vendored
@ -291,7 +291,7 @@ class SingleYearRenderer implements IOutputGenerator
|
||||
$html .= '</g>' . "\n";
|
||||
$html .= '</svg>' . "\n";
|
||||
$html .= '<div class="svg-tip n"">' . "\n";
|
||||
$html .= '<strong> </strong><span> </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"> </strong><span class="date"> </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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user