[src/actions:fix] github (new design) star toggle

This commit is contained in:
Maddison Hellstrom 2020-06-18 13:34:13 -07:00
parent 2abef7195e
commit 9773023d0d
1 changed files with 7 additions and 1 deletions

View File

@ -273,7 +273,13 @@ actions.dg.goog = () => {
// ------ // ------
actions.gh = {} actions.gh = {}
actions.gh.star = ({ toggle = false } = {}) => async () => { actions.gh.star = ({ toggle = false } = {}) => async () => {
const starContainers = [...document.querySelectorAll("div.starring-container")] const hasDisplayNoneParent = (e) =>
window.getComputedStyle(e).display === "none"
|| (e.parentElement ? hasDisplayNoneParent(e.parentElement) : false)
const starContainers = Array.from(document.querySelectorAll("div.starring-container"))
.filter((e) => !hasDisplayNoneParent(e))
if (starContainers.length === 0) return if (starContainers.length === 0) return
let container let container