mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 11:15:36 -05:00
Use a recommended method (#363)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user