Some App Inventor users were reporting issues where multiple blocks
were being created when dragging from the flyout. This commit adds a
lastBlockCreated field on the flyout that is used to detect whether a
creation operation has occurred since the last time the flyout was
opened. This field is cleared as part of clearOldBlocks_, which is
called during each show operation.
FieldTextInput was not triggering a Change event and this prevented an
onWorkspaceChanged event from firing in the BlocklyPanel. This commit
separates the semantics of the text and value getter/setters so that
updates to the text in onHtmlInputChange handler do not prevent an
event being triggered in setValue() after the user commits the change.
When a Blockly workspace has not been rendered for the first time,
e.g. due to Firefox SVG exceptions, the comment bubbles do not have a
canvas to attach to. This fix sets a `visible` field on the comment
object during load of a Blockly workspace that can be used to trigger
an SVG update once the workspace has been rendered.
* Add a workspace drag surface that blocks and bubble get moved to during a workspace drag.
The surface is translated using translate3d instead of svg's translate attribute so that
the browser does not have to repaint the entire workspace on every mouse move.
This is very similar to the block drag surface.
* Address code review comments
* add back hasClass_ utility removed in #748 and stop using contains since it is not supported in IE
* 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.
* Split the scrollbar and flyout out into their own SVG elements. They
are siblings of the workpsace SVG. This paves the way to make performance
improvements to workspace dragging.
Before, touchpads would give "smoother" scrolling by delivering lots of
mousewheel events with small distance changes. Because the code only
looked at the sign of deltaY, ten 5px scrolls would zoom 10x more than
one 50px scroll.
This change makes zooming with a touchpad more like zooming with a
mousewheel. On my laptop, a full-scale zoom (fully out to fully in) was
about a 5mm finger movement before, and is now about 3cm.
Fixes#758.
This commit removes AI2 specific code for the context menu and
replaces it with a customization callback that can be overriden by
Blockly customization.