mirror of
https://github.com/pi-hole/web.git
synced 2025-12-23 12:18:26 +00:00
@@ -1063,14 +1063,24 @@ var customTooltips = function(tooltip) {
|
||||
innerHtml += '<tr><th>' + title + '</th></tr>';
|
||||
});
|
||||
innerHtml += '</thead><tbody>';
|
||||
var printed = 0;
|
||||
bodyLines.forEach(function(body, i) {
|
||||
var colors = tooltip.labelColors[i];
|
||||
var style = 'background:' + colors.backgroundColor;
|
||||
style += '; border-color:' + colors.borderColor;
|
||||
style += '; border-width: 2px';
|
||||
var span = '<span class="chartjs-tooltip-key" style="' + style + '"></span>';
|
||||
var num = body[0].split(':');
|
||||
if(num[1] > 0)
|
||||
{
|
||||
innerHtml += '<tr><td>' + span + body + '</td></tr>';
|
||||
printed++;
|
||||
}
|
||||
});
|
||||
if(printed < 1)
|
||||
{
|
||||
innerHtml += '<tr><td>No activity recorded</td></tr>';
|
||||
}
|
||||
innerHtml += '</tbody>';
|
||||
var tableRoot = tooltipEl.querySelector('table');
|
||||
tableRoot.innerHTML = innerHtml;
|
||||
@@ -1086,4 +1096,4 @@ var customTooltips = function(tooltip) {
|
||||
tooltipEl.style.fontStyle = tooltip._bodyFontStyle;
|
||||
tooltipEl.style.padding = tooltip.yPadding + 'px ' + tooltip.xPadding + 'px';
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user