From 575448d8a2bfb54957ef908b1ba13d51da1180d0 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Fri, 6 Sep 2024 15:35:55 -0700 Subject: [PATCH] www: work around some webkit quirks Fixes bug 875 --- teslausb-www/html/index.html | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/teslausb-www/html/index.html b/teslausb-www/html/index.html index 3e7f0b2c..e231a5a2 100755 --- a/teslausb-www/html/index.html +++ b/teslausb-www/html/index.html @@ -376,7 +376,7 @@ border: none; outline: none; color: white; - padding: 14px 13px; + padding: 14px 12px; background-color: inherit; font-family: inherit; margin: 0; @@ -1008,6 +1008,8 @@ var isWebkit = navigator.userAgent.toLowerCase().indexOf('applewebkit') > -1; var DEBUG = false; +var WORK_AROUND_WEBKIT_QUIRKS = true; + function log(what) { if (DEBUG) { console.log(what); @@ -2603,6 +2605,11 @@ } } + var nr = document.querySelector(".noclips"); + if (WORK_AROUND_WEBKIT_QUIRKS) { + nr.style.display="none"; + nr.style.display=''; + } for (i of ["RecentClips", "SavedClips", "SentryClips"]) { var d=document.getElementById(i); for (c in videos[i]) { @@ -2634,8 +2641,12 @@ if ((d.childElementCount / cols) < 3) { cols = Math.ceil(d.childElementCount / 3); } + if (WORK_AROUND_WEBKIT_QUIRKS) { + d.parentElement.style.display="none"; + d.parentElement.style.display=''; + } if (cols < 2) { - d.style.left = d.parentElement.getBoundingClientRect().left - 8 + "px"; + d.style.left = Math.max(2, d.parentElement.getBoundingClientRect().left - 8) + "px"; } d.style.width = (cols * 156) + "px"; d.parentElement.onmouseenter = function(ev) { @@ -2649,7 +2660,7 @@ if (newestsequence != undefined) { newestsequence.select(); } - document.querySelector(".noclips").innerHTML = "No recordings"; + nr.innerHTML = "No recordings"; initialize(); } });