mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 22:17:21 +03:00
popup votebuttons disappear fix (#1493)
Co-authored-by: Ajay <dev@ajay.app>
This commit is contained in:
15
src/popup.ts
15
src/popup.ts
@@ -83,6 +83,9 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
let segmentTab = SegmentTab.Segments;
|
let segmentTab = SegmentTab.Segments;
|
||||||
let port: chrome.runtime.Port = null;
|
let port: chrome.runtime.Port = null;
|
||||||
|
|
||||||
|
//saves which detail elemts are opened, by saving the uuids
|
||||||
|
const openedUUIDs: SegmentUUID[] = [];
|
||||||
|
|
||||||
const PageElements: PageElements = {};
|
const PageElements: PageElements = {};
|
||||||
|
|
||||||
[
|
[
|
||||||
@@ -603,6 +606,18 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
|
|
||||||
const votingButtons = document.createElement("details");
|
const votingButtons = document.createElement("details");
|
||||||
votingButtons.classList.add("votingButtons");
|
votingButtons.classList.add("votingButtons");
|
||||||
|
votingButtons.id = "votingButtons" + UUID;
|
||||||
|
votingButtons.addEventListener("toggle", () => {
|
||||||
|
if (votingButtons.open) {
|
||||||
|
openedUUIDs.push(UUID);
|
||||||
|
} else {
|
||||||
|
const index = openedUUIDs.indexOf(UUID);
|
||||||
|
if (index !== -1) {
|
||||||
|
openedUUIDs.splice(openedUUIDs.indexOf(UUID), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
votingButtons.open = openedUUIDs.some((u) => u === UUID);
|
||||||
|
|
||||||
//thumbs up and down buttons
|
//thumbs up and down buttons
|
||||||
const voteButtonsContainer = document.createElement("div");
|
const voteButtonsContainer = document.createElement("div");
|
||||||
|
|||||||
Reference in New Issue
Block a user