mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 14:32:59 -05:00
add ability to refresh workspace for current editing target
This commit is contained in:
parent
93bac9ad85
commit
2fb502fb70
1 changed files with 11 additions and 0 deletions
|
@ -469,6 +469,17 @@ class VirtualMachine extends EventEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Repopulate the workspace with the blocks of the current editingTarget. This
|
||||
* allows us to get around bugs like gui#413.
|
||||
*/
|
||||
refreshWorkspace () {
|
||||
if (this.editingTarget) {
|
||||
this.emitWorkspaceUpdate();
|
||||
this.runtime.setEditingTarget(this.editingTarget);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit metadata about available targets.
|
||||
* An editor UI could use this to display a list of targets and show
|
||||
|
|
Loading…
Reference in a new issue