Skip to content

Commit

Permalink
Cleanup and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Feb 23, 2024
1 parent 61f6e08 commit 6e5cc0d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/common/Paginator.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
inputValue = page;
return;
}
console.debug("Paginator: Page changed to ", page);
const { value } = event.target as HTMLInputElement;
goTo(parseInt(value));
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/app/ActionBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<span class="narrowhide">
<Paginator
page={$search.page}
totalPages={$search.results.numPages}
totalPages={$search.results?.numPages}
on:next={searchNext}
on:previous={searchPrev}
has_next={$search.hasNext}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/app/Documents.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
<div class="narrowshow">
<Paginator
page={$search.page}
totalPages={$search.results.numPages}
totalPages={$search.results?.numPages}
on:next={searchNext}
on:previous={searchPrev}
has_next={$search.hasNext}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/app/EmbedFooter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="paginator">
<Paginator
page={$search.page}
totalPages={$search.results.numPages}
totalPages={$search.results?.numPages}
on:next={searchNext}
on:previous={searchPrev}
has_next={$search.hasNext}
Expand Down
8 changes: 2 additions & 6 deletions src/pages/viewer/controls/Paginator.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script lang="ts">
<script>
import { doc } from "../../../viewer/document.js";
import { viewer } from "../../../viewer/viewer.js";
import Paginator from "../../../common/Paginator.svelte";
Expand All @@ -9,13 +9,9 @@
$: totalPages = $viewer.document?.pageCount;
$: has_next = page < totalPages;
$: has_previous = page > 1;
$: {
console.debug({ page, totalPages, has_next, has_previous });
}
function goToPage(event: CustomEvent) {
function goToPage(event) {
const page = event.detail;
console.debug("Go to page ", page);
doc.jumpToPage(page - 1);
}
</script>
Expand Down

0 comments on commit 6e5cc0d

Please sign in to comment.