Commit 29d692c2 authored by Arne Keller's avatar Arne Keller
Browse files

Optimize unification view

parent 520960fe
......@@ -13,9 +13,7 @@ class MathjaxUnification extends MathjaxAdapter {
}
}
protected showStep(_n: number): void {
this.requestTypeset(null);
}
protected showStep(_n: number): void {}
protected calculateSteps(_extraData: any) {
const root = this.shadowRoot!;
......@@ -37,6 +35,16 @@ class MathjaxUnification extends MathjaxAdapter {
prooftree.handleHoverEvent(e as MouseEvent, false);
});
}
protected showLatex(code: string): void {
let el = this.shadowRoot!.getElementById("tc-content");
if (!el) {
setTimeout(() => this.showLatex(code), 50);
return;
}
el.innerHTML = code;
this.requestTypeset(null);
}
}
customElements.define('tc-unification', MathjaxUnification);
......@@ -41,7 +41,7 @@
}
tc-explanation {
max-width: 40em;
width: 100em;
padding-left: 1em;
padding-right: 1em;
overflow-y: auto;
......
......@@ -43,12 +43,7 @@ public class MathjaxUnification extends LitTemplate implements MathjaxAdapter {
@Override
public void showStep(int n) {
if (n < latex.length) {
content.removeAll();
// add latex as HTML because <br> is used in the latex code
content.add(new Html("<div>" + latex[n] + "</div>"));
}
getElement().callJsFunction("showStep", n);
getElement().callJsFunction("showLatex", latex[n]);
}
}
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