mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-03 08:57:14 +03:00
Fix reverse scroll bar scrolling with bar pull (#6968)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
7d91ffee77
commit
23027deb17
@ -194,8 +194,13 @@
|
||||
const topBar = Y - rectScroll.y - shiftTop - 2
|
||||
const heightScroll = rectScroll.height - 4 - divBar.clientHeight - shiftTop - shiftBottom
|
||||
const procBar = topBar / heightScroll
|
||||
divScroll.scrollTop = (divScroll.scrollHeight - divScroll.clientHeight) * procBar
|
||||
|
||||
if (scrollDirection === 'vertical-reverse') {
|
||||
divScroll.scrollTop = (divScroll.scrollHeight - divScroll.clientHeight) * (procBar - 1)
|
||||
} else {
|
||||
divScroll.scrollTop = (divScroll.scrollHeight - divScroll.clientHeight) * procBar
|
||||
}
|
||||
} else if (isScrolling === 'horizontal') {
|
||||
let X = event.clientX - dXY
|
||||
if (X < rectScroll.left + 2 + shiftLeft) X = rectScroll.left + 2 + shiftLeft
|
||||
if (X > rectScroll.right - divBarH.clientWidth - (mask !== 'none' ? 12 : 2) - shiftRight) {
|
||||
@ -513,9 +518,13 @@
|
||||
divBar.style.top = `${topBar}px`
|
||||
const heightScroll = rectScroll.height - 4 - barHeight - shiftTop - shiftBottom
|
||||
const procBar = (topBar - rectScroll.top - shiftTop - 2) / heightScroll
|
||||
if (scrollDirection === 'vertical-reverse') {
|
||||
divScroll.scrollTop = (divScroll.scrollHeight - divScroll.clientHeight) * (procBar - 1)
|
||||
} else {
|
||||
divScroll.scrollTop = (divScroll.scrollHeight - divScroll.clientHeight) * procBar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$: topButton =
|
||||
(orientir === 'vertical' && (mask === 'top' || mask === 'both')) ||
|
||||
@ -655,6 +664,7 @@
|
||||
<div
|
||||
class="bar"
|
||||
class:hovered={isScrolling === 'vertical'}
|
||||
class:reverse={scrollDirection === 'vertical-reverse'}
|
||||
bind:this={divBar}
|
||||
on:mousedown|stopPropagation={(ev) => {
|
||||
onScrollStart(ev, 'vertical')
|
||||
@ -895,6 +905,11 @@
|
||||
max-height: calc(100% - 12px);
|
||||
transform: scaleX(0.5);
|
||||
|
||||
&.reverse {
|
||||
top: auto;
|
||||
bottom: 2px;
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&.hovered {
|
||||
transform: scaleX(1);
|
||||
|
Loading…
Reference in New Issue
Block a user