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