wip
This commit is contained in:
parent
a2f3947bfc
commit
dafc6b2d45
|
@ -204,16 +204,14 @@ function refreshFinished() {
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (rootEl.value == null) return;
|
if (rootEl.value == null) return;
|
||||||
|
|
||||||
scrollEl = getScrollContainer(rootEl.value);
|
scrollEl = getScrollContainer(rootEl.value);
|
||||||
|
|
||||||
rootEl.value.addEventListener('pointerdown', moveStart, { passive: true });
|
rootEl.value.addEventListener('pointerdown', moveStart, { passive: true });
|
||||||
rootEl.value.addEventListener('touchend', toggleScrollLockOnTouchEnd, { passive: true });
|
rootEl.value.addEventListener('touchend', toggleScrollLockOnTouchEnd, { passive: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
rootEl.value.removeEventListener('pointerdown', moveStart);
|
if (rootEl.value) rootEl.value.removeEventListener('pointerdown', moveStart);
|
||||||
rootEl.value.removeEventListener('touchend', toggleScrollLockOnTouchEnd);
|
if (rootEl.value) rootEl.value.removeEventListener('touchend', toggleScrollLockOnTouchEnd);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -96,8 +96,8 @@ provide('tl_withSensitive', computed(() => props.withSensitive));
|
||||||
provide('inChannel', computed(() => props.src === 'channel'));
|
provide('inChannel', computed(() => props.src === 'channel'));
|
||||||
|
|
||||||
function isTop() {
|
function isTop() {
|
||||||
if (scrollContainer == null) return false;
|
if (scrollContainer == null) return true;
|
||||||
if (rootEl.value == null) return false;
|
if (rootEl.value == null) return true;
|
||||||
const scrollTop = scrollContainer.scrollTop;
|
const scrollTop = scrollContainer.scrollTop;
|
||||||
const tlTop = rootEl.value.offsetTop - scrollContainer.offsetTop;
|
const tlTop = rootEl.value.offsetTop - scrollContainer.offsetTop;
|
||||||
return scrollTop <= tlTop;
|
return scrollTop <= tlTop;
|
||||||
|
|
Loading…
Reference in New Issue