web/DonateOptionsCard: update buttons on wheel too

This commit is contained in:
wukko 2024-09-27 21:01:41 +06:00
parent 6ba27f8369
commit ebf2d493aa
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2

View file

@ -169,7 +169,12 @@
<div <div
id="donation-options" id="donation-options"
bind:this={donateList} bind:this={donateList}
on:scroll={(e) => {}} on:wheel={() => {
const currentPos = donateList.scrollLeft;
const maxPos = donateList.scrollWidth - donateList.getBoundingClientRect().width;
showLeftScroll = currentPos > 0;
showRightScroll = currentPos < maxPos && currentPos !== maxPos;
}}
> >
{#each Object.entries(PRESET_DONATION_AMOUNTS) as [amount, component]} {#each Object.entries(PRESET_DONATION_AMOUNTS) as [amount, component]}
<DonationOption <DonationOption