mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Target workspace is the one that carries the variables we want. VarCreate gets fired when a block with a new default variable is dragged out into the workspace.
This commit is contained in:
@@ -606,7 +606,7 @@ Blockly.Flyout.prototype.onMouseDown_ = function(e) {
|
||||
Blockly.Flyout.prototype.createBlock = function(originalBlock) {
|
||||
var newBlock = null;
|
||||
Blockly.Events.disable();
|
||||
var variablesBeforeCreation = this.workspace_.getAllVariables();
|
||||
var variablesBeforeCreation = this.targetWorkspace_.getAllVariables();
|
||||
this.targetWorkspace_.setResizesEnabled(false);
|
||||
try {
|
||||
newBlock = this.placeNewBlock_(originalBlock);
|
||||
@@ -616,7 +616,7 @@ Blockly.Flyout.prototype.createBlock = function(originalBlock) {
|
||||
Blockly.Events.enable();
|
||||
}
|
||||
|
||||
var variablesAfterCreation = this.workspace_.getAllVariables();
|
||||
var variablesAfterCreation = this.targetWorkspace_.getAllVariables();
|
||||
var variablesToFireVarCreate = [];
|
||||
if (variablesBeforeCreation.length != variablesAfterCreation.length) {
|
||||
for (var i = 0; i < variablesAfterCreation.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user