Skip to content

Commit

Permalink
issue 923 allow search results paging on single page (#1053)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmisson authored Jul 17, 2024
1 parent 5759361 commit fd024b6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ export class FooterPanel extends BaseFooterPanel<
this.isZoomToSearchResultEnabled() &&
(<OpenSeadragonExtension>this.extension).currentAnnotationRect
) {
if (currentCanvasIndex > lastSearchResultCanvasIndex) {
if (currentCanvasIndex > lastSearchResultCanvasIndex) { //if you've moved past final result page
return false;
} else if (currentCanvasIndex === lastSearchResultCanvasIndex) {
} else if (currentCanvasIndex === lastSearchResultCanvasIndex) { // if you're on the final result page
if (
currentSearchResultRectIndex === this.getLastSearchResultRectIndex()
currentSearchResultRectIndex === this.getLastSearchResultRectIndex() //and you're on the last result
) {
return false;
}
Expand All @@ -380,7 +380,7 @@ export class FooterPanel extends BaseFooterPanel<
return true;
}

return currentCanvasIndex < lastSearchResultCanvasIndex;
return currentCanvasIndex <= lastSearchResultCanvasIndex;
}

getSearchResults(): AnnotationGroup[] {
Expand Down

0 comments on commit fd024b6

Please sign in to comment.