Commit e4b3d5b5 authored by christianrhansen's avatar christianrhansen

created CellHandlerMobile

parent 2853b20e
<template lang="pug">
.handler-new-cell.text-dark.justify-center.row.bg-white.shadow-6(ref="targetHandler")
slot
</template>
<script>
export default {
props: ['element'],
mounted () {
let observer = new IntersectionObserver(this.observerCallback)
observer.observe(this.$refs.targetHandler)
this.observer = observer
},
methods: {
observerCallback (entries) {
let target = entries[0]
if (!target.isIntersecting) {
this.$emit('onIntersectionChange', {element: this.element, offset: target.boundingClientRect.left})
}
else {
this.$emit('onIntersectionChange', {element: this.element, offset: undefined})
}
}
},
name: 'CellHandlerMobile'
}
</script>
<style scoped lang="stylus">
handler-width = 40px
.handler-new-cell
width handler-width
height handler-width
border-radius 1000px
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment