Merge branch 'master' of https://github.com/ZXY101/z-reader into jidoujisho-testing
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { Page } from '$lib/types';
|
||||
import { onMount } from 'svelte';
|
||||
import { afterUpdate, onMount } from 'svelte';
|
||||
import TextBoxes from './TextBoxes.svelte';
|
||||
import { zoomDefault } from '$lib/panzoom';
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
legacy.style.backgroundImage = url;
|
||||
}
|
||||
}
|
||||
|
||||
afterUpdate(() => {
|
||||
zoomDefault();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
import { page as pageStore } from '$app/stores';
|
||||
import SettingsButton from './SettingsButton.svelte';
|
||||
import { getCharCount } from '$lib/util/count-chars';
|
||||
import { afterUpdate } from 'svelte';
|
||||
|
||||
// TODO: Refactor this whole mess
|
||||
export let volumeSettings: VolumeSettings;
|
||||
@@ -68,7 +69,7 @@
|
||||
volume.mokuroData.volume_uuid,
|
||||
pageClamped,
|
||||
getCharCount(pages, pageClamped) || 0,
|
||||
pageClamped === pages.length
|
||||
pageClamped === pages.length || pageClamped === pages.length - 1
|
||||
);
|
||||
zoomDefault();
|
||||
}
|
||||
@@ -110,14 +111,18 @@
|
||||
|
||||
switch (action) {
|
||||
case 'ArrowLeft':
|
||||
case 'ArrowUp':
|
||||
case 'PageUp':
|
||||
left(event, true);
|
||||
return;
|
||||
case 'ArrowUp':
|
||||
case 'PageUp':
|
||||
changePage(page - navAmount, true);
|
||||
return;
|
||||
case 'ArrowRight':
|
||||
right(event, true);
|
||||
return;
|
||||
case 'ArrowDown':
|
||||
case 'PageDown':
|
||||
right(event, true);
|
||||
changePage(page + navAmount, true);
|
||||
return;
|
||||
case 'Home':
|
||||
changePage(1, true);
|
||||
@@ -197,6 +202,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let shouldUpdate = false;
|
||||
|
||||
function handleUpdate() {
|
||||
shouldUpdate = true;
|
||||
}
|
||||
|
||||
$: volumeSettings.singlePageView && handleUpdate();
|
||||
|
||||
afterUpdate(() => {
|
||||
if (shouldUpdate) {
|
||||
shouldUpdate = false;
|
||||
zoomDefault();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
|
||||
@@ -12,8 +12,12 @@
|
||||
const { volumeName, mokuroData } = volume as Volume;
|
||||
|
||||
$: currentPage = $progress?.[volume?.mokuroData.volume_uuid || 0] || 1;
|
||||
$: progressDisplay = `${currentPage} / ${volume.mokuroData.pages.length}`;
|
||||
$: isComplete = currentPage === volume.mokuroData.pages.length;
|
||||
$: progressDisplay = `${
|
||||
currentPage === volume.mokuroData.pages.length - 1 ? currentPage + 1 : currentPage
|
||||
} / ${volume.mokuroData.pages.length}`;
|
||||
$: isComplete =
|
||||
currentPage === volume.mokuroData.pages.length ||
|
||||
currentPage === volume.mokuroData.pages.length - 1;
|
||||
</script>
|
||||
|
||||
{#if $page.params.manga}
|
||||
|
||||
Reference in New Issue
Block a user