Skip to content

Commit

Permalink
fix link-generation in einzelverssynopse
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Flick committed Oct 12, 2024
1 parent e76c204 commit 004b823
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/lib/components/VerseSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
let additional = '';
let thirtiesVal = Number(coordinates[0]);
function handleInput(/** @type {Event} */ e) {
if (e.target instanceof HTMLInputElement) {
validateMinMax(e.target);
Expand All @@ -41,6 +43,11 @@
}
}
};
$: if (thirtiesVal === 257) {
verse.max = '32';
} else if (verse?.max) {
verse.max = '30';
}
</script>
<form
Expand All @@ -63,7 +70,7 @@
max="827"
on:input={handleInput}
bind:this={thirties}
value={Number(coordinates[0])}
bind:value={thirtiesVal}
/>.<input
type="number"
placeholder="Vers"
Expand Down
6 changes: 3 additions & 3 deletions src/routes/einzelverssynopse/[thirties]/[verse]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
vorheriger Vers
</a>
{/if}
{#if !(parseInt(thirties) === 827 && parseInt(verse) === 30)}
{#if !(parseInt(thirties) === 827 && parseInt(verse) >= 30)}
<a
class="anchor"
href="{base}/einzelverssynopse/{parseInt(verse) === 30
href="{base}/einzelverssynopse/{parseInt(verse) >= 30
? parseInt(thirties) + 1
: thirties}/{parseInt(verse) === 30 ? 1 : parseInt(verse) + 1}"
: thirties}/{parseInt(verse) >= 30 ? 1 : parseInt(verse) + 1}"
>
nächster Vers
</a>
Expand Down

0 comments on commit 004b823

Please sign in to comment.