Commit 92a3442d by Johannes Edmeier

Fix Scrolling for MS Edge in JMX view

parent 8a39be78
......@@ -181,8 +181,15 @@
await this.$nextTick();
const el = document.getElementById(newVal.descriptor.raw);
if (el) {
const top = el.getBoundingClientRect().top + window.scrollY - 100;
window.scroll({top, left: window.scrollX, behavior: 'smooth'});
const scrollingEl = document.scrollingElement;
const instanceTabs = document.querySelector('#instance-tabs');
const navbarOffset = (instanceTabs ? instanceTabs.getBoundingClientRect().bottom : 120) + 10;
const top = scrollingEl.scrollTop + el.getBoundingClientRect().top - navbarOffset;
if (scrollingEl.scrollTo) {
scrollingEl.scrollTo({top, behavior: 'smooth'})
} else {
scrollingEl.scrollTop = top;
}
}
}
}
......
......@@ -100,10 +100,10 @@
});
},
onScroll() {
const scrollingElement = document.scrollingElement;
const scrollingEl = document.scrollingElement;
const visibleHeight = document.documentElement.clientHeight;
this.atBottom = visibleHeight === scrollingElement.scrollHeight - scrollingElement.scrollTop;
this.atTop = scrollingElement.scrollTop <= 0;
this.atBottom = visibleHeight === scrollingEl.scrollHeight - scrollingEl.scrollTop;
this.atTop = scrollingEl.scrollTop <= 0;
},
scrollToTop() {
document.scrollingElement.scrollTop = 0;
......
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