[src/actions:fix] github (new design) star toggle
This commit is contained in:
parent
2abef7195e
commit
9773023d0d
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue