Making charts more mobile friendly on "Today's Detections"

This commit is contained in:
ehpersonal38
2023-03-07 18:10:24 -05:00
parent 6d6a09f2ff
commit 534004acf6
+5 -1
View File
@@ -656,7 +656,11 @@ function generateMiniGraph(elem, comname) {
// Position the chart window to the right of the button
var buttonRect = elem.getBoundingClientRect();
var chartRect = chartWindow.getBoundingClientRect();
chartWindow.style.left = (buttonRect.right + 10) + 'px';
if (window.innerWidth < 700) {
chartWindow.style.left = 'calc(75% - ' + (chartRect.width / 2) + 'px)';
} else {
chartWindow.style.left = (buttonRect.right + 10) + 'px';
}
// Calculate the top position of the chart to center it with the button
var buttonCenter = buttonRect.top + (buttonRect.height / 2);