Skip to content

Commit 45e6d8c

Browse files
committed
Better fix for per-site permissions UI glitches (thanks barbaz for reporting).
1 parent 2013c8e commit 45e6d8c

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/ui/ui.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,3 +505,18 @@ legend {
505505
#high-contrast-chooser {
506506
display: none;
507507
}
508+
509+
.hilite {
510+
background-color: #850 !important;
511+
}
512+
.hilite-end {
513+
transition: 1s background-color;
514+
}
515+
.hilite .url {
516+
transform: scale(2);
517+
transition: none;
518+
}
519+
.hilite-end .url {
520+
transform: none;
521+
transition: 1s transform;
522+
}

src/ui/ui.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -897,18 +897,16 @@ var UI = (() => {
897897
highlight(key) {
898898
key = Sites.toExternal(key);
899899
for (let r of this.allSiteRows()) {
900-
if (r.querySelector(".full-address").textContent.trim().replace(/^.*:\/\//, '') === key) {
901-
let url = r.lastElementChild;
902-
url.style.transition = r.style.transition = "none";
903-
r.style.backgroundColor = "#850";
904-
url.style.transform = "scale(2)";
900+
if (key === r.siteMatch) {
901+
r.classList.add("hilite");
905902
r.querySelector("input.preset:checked").focus();
906903
window.setTimeout(() => {
907-
r.style.transition = "1s background-color";
908-
url.style.transition = "1s transform";
909-
r.style.backgroundColor = "";
910-
url.style.transform = "none";
904+
r.classList.remove("hilite");
905+
r.classList.add("hilite-end");
911906
r.scrollIntoView();
907+
window.setTimeout(() => {
908+
r.classList.remove("hilite-end");
909+
}, 1000)
912910
}, 50);
913911
break;
914912
}

0 commit comments

Comments
 (0)