Skip to content

Commit

Permalink
Fix project tables sidebar label (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
Katsute authored Sep 30, 2022
1 parent 4d1c149 commit 10fed5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ const whenElementAdded = (selector, f) => {
if(window.location.pathname.toLowerCase().includes("/projects/"))
whenElementAdded(`#__primerPortalRoot__`, (e) => {
e.addEventListener("DOMNodeInserted", (i) => {
if(i.target.tagName && i.target.tagName.toLowerCase() == "svg") // find svg
for(const child of i.target.children) // check svg content
if(child.getAttribute("d") == "M11.28 6.78a.75.75 0 00-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 00-1.06 1.06l2 2a.75.75 0 001.06 0l3.5-3.5z") // checkmark
let svg;
if(svg = i.target.querySelector("figure > span > svg"))
for(const child of svg.children) // check svg content
if(child.getAttribute("d") == "M11.28 6.78a.75.75 0 00-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 00-1.06 1.06l2 2a.75.75 0 001.06 0l3.5-3.5z") // check
return setTimeout(() => {
i.target.parentElement.classList.add("rissue-closed-bg"); // apply css
svg.parentElement.classList.add("rissue-closed-bg"); // apply css
}, 100); // doesn't work unless we delay
});
});
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "GitHub Red Issues",
"author": "Katsute",
"description": "Revert closed GitHub issues from purple back to red.",
"version": "3.4",
"version": "3.5",
"homepage_url": "https://github.com/KatsuteDev/GitHub-Red-Issues",
"icons": {
"16": "icon16.png",
Expand Down

0 comments on commit 10fed5b

Please sign in to comment.