Better fix for per-site permissions UI glitches (thanks barbaz for reporting).

This commit is contained in:
hackademix 2021-01-10 22:32:42 +01:00
parent 2013c8e1ae
commit 45e6d8c03d
2 changed files with 22 additions and 9 deletions

View File

@ -505,3 +505,18 @@ legend {
#high-contrast-chooser {
display: none;
}
.hilite {
background-color: #850 !important;
}
.hilite-end {
transition: 1s background-color;
}
.hilite .url {
transform: scale(2);
transition: none;
}
.hilite-end .url {
transform: none;
transition: 1s transform;
}

View File

@ -897,18 +897,16 @@ var UI = (() => {
highlight(key) {
key = Sites.toExternal(key);
for (let r of this.allSiteRows()) {
if (r.querySelector(".full-address").textContent.trim().replace(/^.*:\/\/…/, '') === key) {
let url = r.lastElementChild;
url.style.transition = r.style.transition = "none";
r.style.backgroundColor = "#850";
url.style.transform = "scale(2)";
if (key === r.siteMatch) {
r.classList.add("hilite");
r.querySelector("input.preset:checked").focus();
window.setTimeout(() => {
r.style.transition = "1s background-color";
url.style.transition = "1s transform";
r.style.backgroundColor = "";
url.style.transform = "none";
r.classList.remove("hilite");
r.classList.add("hilite-end");
r.scrollIntoView();
window.setTimeout(() => {
r.classList.remove("hilite-end");
}, 1000)
}, 50);
break;
}