diff --git a/apps/web/src/lib/components/book-reader/reactive-elements.ts b/apps/web/src/lib/components/book-reader/reactive-elements.ts index dfa22ad7..cfacd454 100644 --- a/apps/web/src/lib/components/book-reader/reactive-elements.ts +++ b/apps/web/src/lib/components/book-reader/reactive-elements.ts @@ -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); @@ -37,7 +37,7 @@ export function reactiveElements( anchorTagDocumentListener(contentEl), rubyTagListener(contentEl, furiganaStyle), spoilerImageDocumentListener(contentEl), - openImageInNewTab(contentEl, hideSpoilerImage, includeImgTag) + openImageInNewTab(contentEl, hideSpoilerImage, isExtendedMode) ); } @@ -113,17 +113,19 @@ function spoilerImageListener(document: Document) { function openImageInNewTab( contentEl: HTMLElement, hideSpoilerImage: boolean, - includeImgTag: boolean + isExtendedMode: boolean ) { return merge( - ...[...contentEl.querySelectorAll(`${includeImgTag ? 'img,' : ''}image`)].map( + ...[...contentEl.querySelectorAll(`${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(