Skip to content

Commit

Permalink
www: work around some webkit quirks
Browse files Browse the repository at this point in the history
Fixes bug 875
  • Loading branch information
marcone committed Sep 6, 2024
1 parent 06f4804 commit 575448d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions teslausb-www/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
border: none;
outline: none;
color: white;
padding: 14px 13px;
padding: 14px 12px;
background-color: inherit;
font-family: inherit;
margin: 0;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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]) {
Expand Down Expand Up @@ -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) {
Expand All @@ -2649,7 +2660,7 @@
if (newestsequence != undefined) {
newestsequence.select();
}
document.querySelector(".noclips").innerHTML = "No recordings";
nr.innerHTML = "No recordings";
initialize();
}
});
Expand Down

0 comments on commit 575448d

Please sign in to comment.