mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-04-08 05:16:52 -04:00
fix: run stacks in response to click events (#1)
* fix: run stacks in response to stack click events * refactor: listen for regular click events to run block stacks
This commit is contained in:
parent
1e3b406bd4
commit
12e2362ac6
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue