mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
parent
0f2ba5e8a2
commit
fbb80ae3ad
@ -41,19 +41,11 @@ class MathjaxExplanation extends MathjaxAdapter {
|
|||||||
if (el) {
|
if (el) {
|
||||||
this.lastStepShown = n;
|
this.lastStepShown = n;
|
||||||
// scroll to element if needed
|
// 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 hostEl = this.shadowRoot!.host as HTMLElement;
|
||||||
const dy = el.offsetTop - hostEl.offsetTop - hostEl.scrollTop;
|
const dy = el.offsetTop - hostEl.offsetTop - hostEl.scrollTop;
|
||||||
if (dy > hostEl.offsetHeight || dy < 0) {
|
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);
|
hostEl.scrollBy(0, -hostEl.scrollTop + el.offsetTop - hostEl.offsetTop);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
el.style.opacity = "1.0";
|
el.style.opacity = "1.0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user