Skip to content

Commit 3a92b68

Browse files
committed
fix executing lively_scripts to often in embedded markdown in code mirror
SQUASHED: AUTO-COMMIT-src-components-widgets-lively-script.js,
1 parent f1c8b50 commit 3a92b68

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/components/widgets/lively-script.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ export default class LivelyScript extends Morph {
3232

3333
// evalute script not when the component is initialized, but when it is actually in the DOM
3434
async attachedCallback() {
35+
36+
// we get exectuted to often?
37+
if (this.lastParentElement == this.parentElement) return
38+
this.lastParentElement = this.parentElement
39+
// lively.notify("execute " + this.textContent)
40+
41+
3542
// console.log("SCRIPT attached ", lively.findWorldContext(this))
3643
var src = this.textContent
3744
// console.log("LivelyScript>>initialize " + src)

0 commit comments

Comments
 (0)