mirror of
https://github.com/danbulant/Mangades
synced 2026-06-20 06:41:16 +00:00
fixed and improved scroll
This commit is contained in:
parent
c7e28e8fbd
commit
e11f2c2838
1 changed files with 5 additions and 5 deletions
|
|
@ -67,11 +67,11 @@ import MangadexItems from '../components/mangadexItems.svelte';
|
|||
*/
|
||||
async function scroll(e) {
|
||||
if(scrollSearch !== null) return;
|
||||
if(document.body.scrollHeight - window.scrollY - window.innerHeight < 300 && (await result).results.length < (await result).total) {
|
||||
if(document.body.scrollHeight - window.scrollY - window.innerHeight < 800 && (await result).data.length < (await result).total) {
|
||||
scrollSearch = name;
|
||||
const res = await search(name, filters, (await result).results.length);
|
||||
if(scrollSearch === name && res.results.length) {
|
||||
(await result).results.push(...res.results);
|
||||
const res = await search(name, filters, (await result).data.length);
|
||||
if(scrollSearch === name && res.data.length) {
|
||||
(await result).data.push(...res.data);
|
||||
result = result; // trigger reload
|
||||
}
|
||||
setTimeout(() => {
|
||||
|
|
@ -117,7 +117,7 @@ import MangadexItems from '../components/mangadexItems.svelte';
|
|||
<h1>miniMANGADEX</h1>
|
||||
|
||||
<div class="flex search">
|
||||
<input type="text" placeholder="Enter UUID or URL of mangadex.org manga" bind:value={name}>
|
||||
<input type="text" placeholder="{isLogedIn() ? "Search for manga or enter URL of mangadex.org manga" : "Enter UUID or URL of mangadex.org manga"}" bind:value={name}>
|
||||
<button on:click={open}>Go</button>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue