Use a recommended method (#363)

This commit is contained in:
woxtu
2022-05-18 12:24:33 +09:00
committed by GitHub
parent c04015899b
commit 39774a83c5
5 changed files with 9 additions and 15 deletions

View File

@@ -104,14 +104,9 @@ export class PyRepl extends BaseEvalElement {
addClasses(this.btnRun, ['absolute', 'right-1', 'bottom-1', 'opacity-0', 'group-hover:opacity-100']);
this.editorNode.appendChild(this.btnRun);
this.btnRun.onclick = wrap(this);
function wrap(el: any) {
function evaluatePython() {
el.evaluate();
}
return evaluatePython;
}
this.btnRun.addEventListener('click', () => {
void this.evaluate();
});
if (!this.id) {
console.log(