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 { #high-contrast-chooser {
display: none; 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) { highlight(key) {
key = Sites.toExternal(key); key = Sites.toExternal(key);
for (let r of this.allSiteRows()) { for (let r of this.allSiteRows()) {
if (r.querySelector(".full-address").textContent.trim().replace(/^.*:\/\/…/, '') === key) { if (key === r.siteMatch) {
let url = r.lastElementChild; r.classList.add("hilite");
url.style.transition = r.style.transition = "none";
r.style.backgroundColor = "#850";
url.style.transform = "scale(2)";
r.querySelector("input.preset:checked").focus(); r.querySelector("input.preset:checked").focus();
window.setTimeout(() => { window.setTimeout(() => {
r.style.transition = "1s background-color"; r.classList.remove("hilite");
url.style.transition = "1s transform"; r.classList.add("hilite-end");
r.style.backgroundColor = "";
url.style.transform = "none";
r.scrollIntoView(); r.scrollIntoView();
window.setTimeout(() => {
r.classList.remove("hilite-end");
}, 1000)
}, 50); }, 50);
break; break;
} }