Merge pull request #109 from guastallaigor/fix-intersection-button-send

Works in chrome. Ok for now but needs checks and improvements on other browsers, eg. Firefox.
This commit is contained in:
izerozlu
2019-08-30 16:40:16 +03:00
committed by GitHub

View File

@@ -531,22 +531,16 @@
if (this[key]) this[key] = queries[key];
}
},
observeRequestButton: function () {
let isTheInitialIntersection = true;
const sendButtonElement = this.$refs.sendButton;
const requestElement = this.$refs.request.$el;
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
if (!isTheInitialIntersection) {
sendButtonElement.classList.toggle('show');
} else {
isTheInitialIntersection = false;
}
}
});
}, {threshold: 1});
observer.observe(requestElement);
observeRequestButton() {
const requestElement = this.$refs.request.$el;
const sendButton = this.$refs.sendButton;
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
sendButton.className = entry.isIntersecting ? '' : 'show';
});
}, { threshold: 1 });
observer.observe(requestElement);
}
},
created() {