From 5b6f1debeb5f7c1077954a7ff23056e283de13da Mon Sep 17 00:00:00 2001 From: picklesrus Date: Wed, 14 Dec 2016 14:57:32 -0800 Subject: [PATCH] =?UTF-8?q?Move=20the=20call=20to=20disable=20resize=20bef?= =?UTF-8?q?ore=20placeNewBlock=20so=20that=20it=20is=20of=E2=80=A6=20(#777?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Move the call to disable resize before placeNewBlock so that it is off when workspace resizeContents gets triggered by placeNewBlock. This fixes a bug in rtl mode where the workspace was being resized between when the block was added to the workspace and when it was moved to the proper location. --- core/flyout.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/flyout.js b/core/flyout.js index 3f50fe3f1..72b3f00bb 100644 --- a/core/flyout.js +++ b/core/flyout.js @@ -1162,6 +1162,10 @@ Blockly.Flyout.prototype.createBlockFunc_ = function(originBlock) { return; } Blockly.Events.disable(); + // Disable workspace resizing. Reenable at the end of the drag. This avoids + // a spurious resize between creating the new block and placing it in the + // workspace. + flyout.targetWorkspace_.setResizesEnabled(false); try { var block = flyout.placeNewBlock_(originBlock); } finally { @@ -1181,8 +1185,6 @@ Blockly.Flyout.prototype.createBlockFunc_ = function(originBlock) { Blockly.dragMode_ = Blockly.DRAG_FREE; block.setDragging_(true); block.moveToDragSurface_(); - // Disable workspace resizing. Reenable at the end of the drag. - flyout.targetWorkspace_.setResizesEnabled(false); }; };