Commit fbb80ae3 authored by Arne Keller's avatar Arne Keller
Browse files

Scroll to explanation text if needed

fixes #26
parent 0f2ba5e8
Pipeline #165784 passed with stages
in 9 minutes and 59 seconds
......@@ -41,19 +41,11 @@ class MathjaxExplanation extends MathjaxAdapter {
if (el) {
this.lastStepShown = n;
// scroll to element if needed
/* TODO: this works, but Vaadin still resets the scroll position when updating the unification text...
const hostEl = this.shadowRoot!.host as HTMLElement;
const dy = el.offsetTop - hostEl.offsetTop - hostEl.scrollTop;
if (dy > hostEl.offsetHeight || dy < 0) {
console.log("doing it!");
console.log(dy);
console.log(hostEl.scrollTop);
console.log(hostEl.offsetTop);
console.log(el.offsetTop);
console.log("scrolling by " + (-hostEl.scrollTop + el.offsetTop - hostEl.offsetTop));
hostEl.scrollBy(0, -hostEl.scrollTop + el.offsetTop - hostEl.offsetTop);
}
*/
el.style.opacity = "1.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