Skip to content
Snippets Groups Projects
Commit a36ae100 authored by permcu's avatar permcu
Browse files

Adapt intersect handler to header

by introducing rootMargin.

app-bar & crud-iterator header where not included in top element
calculation.
165 px is again a magic number & should be replaced by direct
references.
But it is still not clear how to get the app-bar height.
parent 257c0896
No related branches found
No related tags found
No related merge requests found
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
v-intersect="{ v-intersect="{
handler: intersectHandler(date, idx, lastIdx), handler: intersectHandler(date, idx, lastIdx),
options: { options: {
rootMargin: '-165px 0px 0px 0px',
threshold: [0, 1], threshold: [0, 1],
}, },
}" }"
...@@ -289,7 +290,8 @@ export default { ...@@ -289,7 +290,8 @@ export default {
const entry = entries[0]; const entry = entries[0];
if (entry.isIntersecting) { if (entry.isIntersecting) {
if (entry.boundingClientRect.top <= 0) { // TODO: Make 165 a var?
if (entry.boundingClientRect.top <= 165) {
console.log('@', date.toISODate()); console.log('@', date.toISODate());
this.setDate(date.toISODate()); this.setDate(date.toISODate());
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment