🐛 Fixed the tool button scroll Y pixes.
This commit is contained in:
parent
6a42188853
commit
b04c1b9aa0
@ -24,23 +24,22 @@ HTMLElement.prototype.wrap = function(wrapper) {
|
|||||||
NexT.utils = {
|
NexT.utils = {
|
||||||
|
|
||||||
registerToolButtons: function() {
|
registerToolButtons: function() {
|
||||||
const comms_offset = document.getElementById('comments').getBoundingClientRect().top + window.scrollY;
|
|
||||||
document.getElementById('goto-comments').addEventListener('click', () => {
|
document.getElementById('goto-comments').addEventListener('click', () => {
|
||||||
window.anime({
|
window.anime({
|
||||||
targets : document.scrollingElement,
|
targets : document.scrollingElement,
|
||||||
duration : 500,
|
duration : 500,
|
||||||
easing : 'linear',
|
easing : 'linear',
|
||||||
scrollTop: comms_offset
|
scrollTop: document.getElementById('comments').getBoundingClientRect().top + window.scrollY
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const gt_offset = document.getElementById('google_translate_element').getBoundingClientRect().top + window.scrollY;
|
|
||||||
document.getElementById('goto-gt').addEventListener('click', () => {
|
document.getElementById('goto-gt').addEventListener('click', () => {
|
||||||
window.anime({
|
window.anime({
|
||||||
targets : document.scrollingElement,
|
targets : document.scrollingElement,
|
||||||
duration : 500,
|
duration : 500,
|
||||||
easing : 'linear',
|
easing : 'linear',
|
||||||
scrollTop: gt_offset
|
scrollTop: document.getElementById('google_translate_element').getBoundingClientRect().top + window.scrollY
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user