move composables to their own folder
This commit is contained in:
parent
62106f0d54
commit
e34f4814c8
3 changed files with 2 additions and 13 deletions
|
|
@ -13,8 +13,8 @@ import {
|
|||
import { useRouter } from 'vue-router'
|
||||
|
||||
import ChatMessageList from 'src/components/chat_message_list/chat_message_list.vue'
|
||||
import { useScrollPosition } from 'src/components/conversation/useScrollPosition.js'
|
||||
import { useWindowSize } from 'src/components/conversation/useWindowSize.js'
|
||||
import { useScrollPosition } from 'src/composables/useScrollPosition.js'
|
||||
import { useWindowSize } from 'src/composables/useWindowSize.js'
|
||||
import PostStatusForm from 'src/components/post_status_form/post_status_form.vue'
|
||||
import QuickFilterSettings from 'src/components/quick_filter_settings/quick_filter_settings.vue'
|
||||
import QuickViewSettings from 'src/components/quick_view_settings/quick_view_settings.vue'
|
||||
|
|
@ -353,17 +353,6 @@ export default {
|
|||
const finalBottomScrollBoundary =
|
||||
realBottomScrollBoundary.value + buffer
|
||||
|
||||
// console.log(
|
||||
// 'TOP SCROLL',
|
||||
// itemBottomBoundary > finalTopScrollBoundary,
|
||||
// itemBottomBoundary, finalTopScrollBoundary,
|
||||
// )
|
||||
// console.log(
|
||||
// 'BOTTOM SCROLL',
|
||||
// itemTopBoundary < finalBottomScrollBoundary,
|
||||
// itemTopBoundary, finalBottomScrollBoundary,
|
||||
// )
|
||||
|
||||
// To be visible, item's bottom boundary shoud be below top scroll boundary)
|
||||
const belowTopBoundary = itemBottomBoundary > finalTopScrollBoundary
|
||||
// To be visible, item's top boundary shoud be above bottom scroll boundary)
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
import { onMounted, onUnmounted, ref } from 'vue'
|
||||
|
||||
export function useScrollPosition() {
|
||||
const x = ref(0)
|
||||
const y = ref(0)
|
||||
|
||||
const update = (e) => {
|
||||
x.value = window.scrollX
|
||||
y.value = window.scrollY
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('scroll', update)
|
||||
update()
|
||||
})
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('scroll', update)
|
||||
})
|
||||
|
||||
return { x, y }
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { onMounted, onUnmounted, ref } from 'vue'
|
||||
|
||||
export function useWindowSize() {
|
||||
const height = ref(0)
|
||||
const width = ref(0)
|
||||
|
||||
const update = () => {
|
||||
height.value = window.innerHeight
|
||||
width.value = window.innerWidth
|
||||
}
|
||||
|
||||
onMounted(() => window.addEventListener('resize', update))
|
||||
onUnmounted(() => window.removeEventListener('resize', update))
|
||||
|
||||
update()
|
||||
|
||||
return { height, width }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue