Skip to content

Commit

Permalink
EPUB: Don't turn page with tap when annotation is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
AbeJellinek committed Oct 31, 2024
1 parent da4aaf0 commit 2cc6470
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/dom/common/dom-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,10 @@ abstract class DOMView<State extends DOMViewState, Data> {
this._updateViewStats();
}

get selectedAnnotationIDs() {
return this._selectedAnnotationIDs.slice();
}

setAnnotationPopup(popup: AnnotationPopupParams<WADMAnnotation>) {
this._annotationPopup = popup;
}
Expand Down
1 change: 1 addition & 0 deletions src/dom/epub/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ export class PaginatedFlow extends AbstractFlow {
}
// If there's no selection, allow single-tap page turns
else if (this._iframeWindow.getSelection()!.isCollapsed
&& !this._view.selectedAnnotationIDs.length
&& Math.abs(event.clientX - this._touchStartX) < EPSILON_PX
&& Math.abs(event.clientY - this._touchStartY) < EPSILON_PX) {
if (event.clientX >= this._iframeWindow.innerWidth - PAGE_TURN_TAP_MARGIN_PX) {
Expand Down

0 comments on commit 2cc6470

Please sign in to comment.