Skip to content

Commit

Permalink
fix: change to fullscreen mode (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
Renji-XD authored Oct 7, 2024
1 parent b939df4 commit 2811a8d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/web/src/lib/components/book-reader/reactive-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function reactiveElements(
document: Document,
furiganaStyle: FuriganaStyle,
hideSpoilerImage: boolean,
includeImgTag: boolean
isExtendedMode: boolean
) {
const anchorTagDocumentListener = anchorTagListener(document);
const spoilerImageDocumentListener = spoilerImageListener(document);
Expand All @@ -37,7 +37,7 @@ export function reactiveElements(
anchorTagDocumentListener(contentEl),
rubyTagListener(contentEl, furiganaStyle),
spoilerImageDocumentListener(contentEl),
openImageInNewTab(contentEl, hideSpoilerImage, includeImgTag)
openImageInNewTab(contentEl, hideSpoilerImage, isExtendedMode)
);
}

Expand Down Expand Up @@ -113,17 +113,19 @@ function spoilerImageListener(document: Document) {
function openImageInNewTab(
contentEl: HTMLElement,
hideSpoilerImage: boolean,
includeImgTag: boolean
isExtendedMode: boolean
) {
return merge(
...[...contentEl.querySelectorAll<HTMLElement>(`${includeImgTag ? 'img,' : ''}image`)].map(
...[...contentEl.querySelectorAll<HTMLElement>(`${isExtendedMode ? 'img,' : ''}image`)].map(
(elm) => {
elm.draggable = false;

return merge(
fromEvent(elm, 'contextmenu').pipe(
tap((event) => {
event.preventDefault();
if (isExtendedMode) {
event.preventDefault();
}
})
),
fromEvent(elm, 'pointerdown').pipe(
Expand Down

0 comments on commit 2811a8d

Please sign in to comment.