File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ const TouchEventManager = {
256
256
const isStylusModeDisabled = ! docViewer . isStylusModeEnabled ( ) ;
257
257
const isUsingAnnotationToolsAndStylusIsDisabled = this . isUsingAnnotationTools ( ) && isStylusModeDisabled ;
258
258
const isUsingPenAndStylusEnabled = this . isUsingPen ( ) && ! isStylusModeDisabled ;
259
+ const { container, document : doc } = this ;
259
260
260
261
if (
261
262
! this . allowSwipe ||
@@ -283,8 +284,9 @@ const TouchEventManager = {
283
284
const isFirstPage = currentPage === 1 ;
284
285
const isLastPage = currentPage === totalPages ;
285
286
const isSingleDisplayMode = ! core . isContinuousDisplayMode ( ) ;
286
- const shouldGoToPrevPage = isSingleDisplayMode && ! isFirstPage && ( ( swipedToLeft && this . allowHorizontalSwipe ) || ( swipedToTop && this . allowVerticalSwipe ) ) ;
287
- const shouldGoToNextPage = isSingleDisplayMode && ! isLastPage && ( ( swipedToRight && this . allowHorizontalSwipe ) || ( swipedToBottom && this . allowVerticalSwipe ) ) ;
287
+ const doesPagesFitOnScreen = doc . clientWidth < container . clientWidth || doc . clientHeight < container . clientHeight ;
288
+ const shouldGoToPrevPage = isSingleDisplayMode && ! isFirstPage && ( ( swipedToLeft && this . allowHorizontalSwipe ) || ( swipedToTop && this . allowVerticalSwipe ) ) && doesPagesFitOnScreen ;
289
+ const shouldGoToNextPage = isSingleDisplayMode && ! isLastPage && ( ( swipedToRight && this . allowHorizontalSwipe ) || ( swipedToBottom && this . allowVerticalSwipe ) ) && doesPagesFitOnScreen ;
288
290
289
291
if ( shouldGoToPrevPage ) {
290
292
core . setCurrentPage ( Math . max ( 1 , currentPage - numberOfPagesToNavigate ) ) ;
You can’t perform that action at this time.
0 commit comments