diff --git a/lib/components/QuizAnswerer.tsx b/lib/components/QuizAnswerer.tsx index 8ce5ef7..451a1b3 100644 --- a/lib/components/QuizAnswerer.tsx +++ b/lib/components/QuizAnswerer.tsx @@ -149,6 +149,7 @@ export default function QuizAnswerer(props: Props) { background: "black", zIndex: 999, opacity: 0, + pointerEvents: "auto", }} /> diff --git a/lib/components/ViewPublicationPage/ViewPublicationPage.tsx b/lib/components/ViewPublicationPage/ViewPublicationPage.tsx index f3a60c3..bcc1f09 100644 --- a/lib/components/ViewPublicationPage/ViewPublicationPage.tsx +++ b/lib/components/ViewPublicationPage/ViewPublicationPage.tsx @@ -44,7 +44,10 @@ export default function ViewPublicationPage() { const overlay = document.getElementById("hideoverlay"); if (root !== null && overlay !== null && settings.cfg?.isUnSc) { - overlay.style.cssText = "pointerEvents = auto;"; + console.log("overlay"); + console.log(overlay); + console.log(overlay.style.cssText); + console.log("-----------------------------------------------"); unscreen(overlay, root); } }, []); diff --git a/lib/ui_kit/unscreen.ts b/lib/ui_kit/unscreen.ts index 4b67e3b..ba98b09 100644 --- a/lib/ui_kit/unscreen.ts +++ b/lib/ui_kit/unscreen.ts @@ -1,11 +1,11 @@ function addOverlay(overlay: HTMLElement) { // const overlay = document.getElementById('overlay'); overlay.style.opacity = "1"; // Затемнено - overlay.style.pointerEvents = "auto"; // Включить клики + overlay.style.display = "inherit"; // } function removeOverlay(overlay: HTMLElement) { overlay.style.opacity = "0"; // Вернуть в исходное состояние - overlay.style.pointerEvents = "none"; // Игнорировать клики + overlay.style.display = "none"; // } function addRemoveOverlayTimer(overlay: HTMLElement, time = 1000) { addOverlay(overlay); @@ -19,7 +19,8 @@ let isMouseInside = true; let isWindowFocused = true; export default function unscreen(overlay: HTMLElement, root: HTMLElement) { - let focusTimeout: NodeJS.Timeout | undefined; + overlay.style.display = "none"; + // Проверка состояния и выполнение нужного действия function checkFocusAndMouse() { if (!isWindowFocused || !isMouseInside) {