Make mobile progress bar position changeable

This commit is contained in:
schroda
2025-01-02 21:25:35 +01:00
parent 92892e6604
commit f90e4597f8
10 changed files with 371 additions and 170 deletions

View File

@@ -133,7 +133,7 @@ const BaseReaderProgressBar = ({
getNextIndexFromPage(
getPageForMousePos(
isTouchEvent ? e.touches[0] : e,
progressBarRef.current.getBoundingClientRect(),
progressBarRef.current,
pages,
isHorizontalPosition,
fullSegmentClicks,
@@ -175,13 +175,12 @@ const BaseReaderProgressBar = ({
<ClickAwayListener onClickAway={() => setIsDragging(false)}>
<ReaderProgressBarSlotsActionArea
{...slotProps?.progressBarSlotsActionArea}
ref={progressBarRef}
onMouseDown={handleMouseDown}
onMouseUp={handleMouseUp}
onTouchStart={handleMouseDown}
onTouchEnd={handleMouseUp}
>
<ReaderProgressBarSlotsContainer {...slotProps?.progressBarSlotsContainer}>
<ReaderProgressBarSlotsContainer ref={progressBarRef} {...slotProps?.progressBarSlotsContainer}>
{pages.map((page, pagesIndex) => (
<ReaderProgressBarSlotWrapper
{...slotProps?.progressBarSlot}