Commit 83bbeb4d authored by christianrhansen's avatar christianrhansen

mobile: watching datasets from move- and resize-handler (buggy)

parent 7a445a07
Subproject commit 1d52a57a6afd99e86bb8bbc3c7766f60dbe1d383
Subproject commit 2853b20e959c71780ddbcdcb2d5ef96a66081c2d
export default ({ Vue }) => {
Vue.directive('intersection-observer', {
inserted: function (el) {
// bind: function (el, binding, vnode) {
bind: function (el) {
const options = {
root: null,
// root: null,
threshold: '0'
}
const observer = new IntersectionObserver(observerCallback, options)
observer.observe(el)
function observerCallback (entries) {
// console.log('entries', entries)
entries.forEach(entry => {
if (entry.isIntersecting) {
console.log('isIntersecting')
// console.log('BINDING', binding)
// console.log('isIntersecting', vnode)
// vnode.context.handlerNewCell.move.dataLeft = undefined
// vnode.context.handlerNewCell.move.dataLeft = undefined
el.dataset.left = 'xxx'
}
else {
console.log('nicht mehr intersecting')
console.log(entry.boundingClientRect.left)
// console.log('nicht mehr intersecting', vnode)
// vnode.context.handlerNewCell.move.dataLeft = entry.boundingClientRect.left
el.dataset.left = entry.boundingClientRect.left
// console.log('plugin', el.dataset)
// console.log(el.dataset.left)
// console.log('----------')
}
})
}
......
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