Fix intersection button send again (removed validation inside forEach)
This commit is contained in:
@@ -531,22 +531,15 @@
|
|||||||
if (this[key]) this[key] = queries[key];
|
if (this[key]) this[key] = queries[key];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
observeRequestButton: function () {
|
observeRequestButton() {
|
||||||
let isTheInitialIntersection = true;
|
const requestElement = this.$refs.request.$el;
|
||||||
const sendButtonElement = this.$refs.sendButton;
|
const observer = new IntersectionObserver((entries, observer) => {
|
||||||
const requestElement = this.$refs.request.$el;
|
entries.forEach(entry => {
|
||||||
const observer = new IntersectionObserver((entries, observer) => {
|
this.$refs.sendButton.classList.toggle('show');
|
||||||
entries.forEach(entry => {
|
});
|
||||||
if (entry.isIntersecting) {
|
}, { threshold: 1 });
|
||||||
if (!isTheInitialIntersection) {
|
|
||||||
sendButtonElement.classList.toggle('show');
|
observer.observe(requestElement);
|
||||||
} else {
|
|
||||||
isTheInitialIntersection = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, {threshold: 1});
|
|
||||||
observer.observe(requestElement);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
Reference in New Issue
Block a user