From 71205de2efa94f996d80adec1c5d3a96365a1ed2 Mon Sep 17 00:00:00 2001 From: Karishma Chadha Date: Wed, 22 Nov 2017 13:27:29 -0500 Subject: [PATCH] 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. --- core/flyout_base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/flyout_base.js b/core/flyout_base.js index 7e01a6b10..84919a7e4 100644 --- a/core/flyout_base.js +++ b/core/flyout_base.js @@ -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++) {