fix: run stacks in response to click events ()

* fix: run stacks in response to stack click events

* refactor: listen for regular click events to run block stacks
This commit is contained in:
Aaron Dodson 2024-04-22 10:35:29 -07:00 committed by GitHub
parent 1e3b406bd4
commit 12e2362ac6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -308,12 +308,6 @@ class Blocks {
const stage = this.runtime.getTargetForStage();
const editingTarget = this.runtime.getEditingTarget();
// UI event: clicked scripts toggle in the runtime.
if (e.element === 'stackclick') {
this.runtime.toggleScript(e.blockId, {stackClick: true});
return;
}
// Block create/update/destroy
switch (e.type) {
case 'create': {
@ -503,6 +497,12 @@ class Blocks {
this.emitProjectChanged();
}
break;
case 'click':
// UI event: clicked scripts toggle in the runtime.
if (e.targetType === 'block') {
this.runtime.toggleScript(this.getTopLevelScript(e.blockId), {stackClick: true});
}
break;
}
}