Commit graph

141 commits

Author SHA1 Message Date
Neil Fraser
7928fac3ce Collapse the five 0/1-based index flags into one option. 2016-10-06 17:54:43 -07:00
Rachel Fenichel
ed983333eb bindEventWithChecks_ for internal use, and bindEvent_ with old behaviour but deprecated 2016-09-23 13:46:11 -07:00
Rachel Fenichel
b771d8daf4 Cleanup 2016-09-07 18:14:05 -07:00
Rachel Fenichel
109e4bb352 Move code to touch.js 2016-09-07 17:42:09 -07:00
Rachel Fenichel
c373d6d091 Make context menus work again; fix dragging from the toolbox with variables. 2016-09-07 15:49:20 -07:00
Rachel Fenichel
706d74c81e Handle touches on/in comments and right-clicks on the workspace 2016-09-01 14:15:03 -07:00
Rachel Fenichel
b77c080678 Fix bugs with missing mouseUp events on mutators. Also stop filtering out key presses. 2016-08-25 15:18:53 -07:00
Rachel Fenichel
cc9396d739 Prefer functions in workspaceSvg to functions in blockly.js 2016-08-19 14:13:20 -07:00
rachel-fenichel
21fea1279c Merge pull request from google/feature/variable_management
Integrate variable management into develop.
2016-08-18 15:56:18 -07:00
Katelyn Mann
33e9d75457 Fix for .
Add a isMutator member similar to isFlyout to workspace_svg so it knows whether
it is mutator or not. Allow blocks to access that property so that they can recalculate
coordinates appropriately.
2016-08-16 11:19:29 -07:00
rachel-fenichel
c7dea98e88 Merge pull request from picklesrus/develop-screenctm-bugs
Fix for .  Recalculate the things that use screen coordinates (de…
2016-08-12 17:15:20 -07:00
Katelyn Mann
244733467d Fix for . Recalculate the things that use screen coordinates (delete area and
screen transformation matrix) when a scroll happened.
This is not done using a scroll handler since the update
is expensive (getScreenCTM and getClientBoundingRect) and we don't need to do it
until the scroll is done and the user is interacting with blocks again.
2016-08-12 16:56:22 -07:00
Rachel Fenichel
a2b3a3638a Merge branch 'develop' into feature/variable_management 2016-08-12 14:32:26 -07:00
Katelyn Mann
bbd57a9a16 Fix by changing workspace's dispose method to remove the injectDiv wrapper of the
svg. The wrapper div was introduced in .
2016-08-11 11:00:02 -07:00
Rachel Fenichel
350e1ff2cc Merge remote-tracking branch 'upstream/develop' into feature/variable_management_merge_develop 2016-08-08 16:58:51 -07:00
Emma Dauterman
831a14e1e4 Made Blockly.WorkspaceSvg.cleanUp public 2016-08-02 17:18:12 -07:00
rachel-fenichel
b4a938f804 Merge pull request from drigz/bugfix/476
Check flyout in isDragging()
2016-07-19 10:58:48 -07:00
Neil Fraser
4f498dc99c Make tooltips reflect from-end indexing behaviour. 2016-07-15 14:55:05 -07:00
Rachel Fenichel
f040929bd8 Merge remote-tracking branch 'upstream/develop' into feature/merge_develop 2016-07-15 13:07:07 -07:00
Rodrigo Queiro
74e905c611 Check flyout in isDragging()
We also have to record startFlyout_ on background scrolls - before
dragMode_ wasn't being reset by terminateDrag() for background scrolls,
which would suppress clicks from that point on.

Fixes .
2016-07-15 10:35:45 +02:00
Rodrigo Queiro
d3d0ca4fd0 Record whether the workspace has been dragged ()
* Record whether the workspace has been dragged

This fixes  by differentiating between a touch on an unmovable block
and using it to drag the workspace.

* Remove isScrolling and add DRAG_BEGIN

Applied after PR review.
2016-07-12 11:34:02 -07:00
Rodrigo Queiro
ab03c4f411 Remove out-of-date comment ()
This comment made sense [before multiple workspace support](67140282a0/core/blockly.js (L297)), where it was near a (Blockly.readOnly || isTargetSvg) check. Now, this logic is implemented in BlockSvg.onMouseDown_() instead.
2016-07-11 16:43:29 -07:00
Neil Fraser
e849c93db9 Merge branch 'master' into develop 2016-07-08 16:52:18 -07:00
Neil Fraser
2dab19c015 Ensure that if a procedure call exists, so does its definition.
Specifically, if a call is copied, then the def is deleted, then the
call is pasted, the def should be created.
2016-07-08 15:50:09 -07:00
Rachel Fenichel
13c6c63daa Create variables from the flyout 2016-07-07 14:39:45 -07:00
Rachel Fenichel
cb3bef8f32 Flyout button with click handler 2016-07-07 14:37:12 -07:00
Neil Fraser
555eac8b7f Simplify field validator chaining. 2016-06-29 17:44:12 -07:00
Rodrigo Queiro
589f6ae13f Re-enable events even when an exception is thrown
This prevents a recoverable exception permanently disabling events. This
could be caused by calling domToWorkspace() to load a corrupt program.
2016-06-29 14:46:06 +02:00
Rodrigo Queiro
2dcb6cb68b Ignore mouseup at end of drag with isDragging ()
This includes both block drags and workspace scrolls and fixes . I
used isDragging rather than checking the origin of click so that it can
easily be extended to the case where the flyout is scrolled by dragging
a block, a la .
2016-06-28 18:11:48 -07:00
Rachel Fenichel
a234506324 Merge branch 'develop' into feature/cache_screen_ctm 2016-06-21 15:57:53 -07:00
Rachel Fenichel
c4cad3c6e4 Cache screen CTM for performance improvement. 2016-06-17 14:26:04 -07:00
Rachel Fenichel
8f601345bb cache delete areas instead of recalculating them onMouseDown 2016-06-17 12:39:18 -07:00
Neil Fraser
fd6f743f0e Remove unneeded generated parens around function calls in indexOf blocks. 2016-06-13 18:49:18 -07:00
picklesrus
6851baea12 Fix . Attash the resize handler to the workspace so it can be removed ()
when workspace.dispose() is called.
2016-06-13 14:46:58 -07:00
Neil Fraser
57131165b0 Routine recompile 2016-06-03 16:12:59 -07:00
picklesrus
213469a479 Change the blockly workspace resizing strategy. ()
* Add a new method to be called when the contents of the workspace change and
the scrollbars need to be adjusted but the the chrome (trash, toolbox, etc)
are expected to stay in the same place.

Change a bunch of calls to svgResize to either be removed or call the new
method instead.  This is a nice performance win since the offsetHeight/Width
call in svgResize can be expensive, especially when called as often as we do -
there was some layout thrashing.

This also paves the way for moving calls to recordDeleteAreas
(which is also expensive) to a more cacheable spot than on every
mouse down/touch event.

of things (namely the scrollbars)

* Fix size of graph demo when it first loads by calling svgResize.
The graph starts with fixed width and was relying on a resize event
to fire (which I believe was removed in commit
217c681b86).

* Fix the resizing of the code demo.  The demo's tab min-width used to
match the toolbox's width was only being set on a resize event, but
commit 217c681b86 changed how that worked.

* Fix up some comments.

* Use specific workspaces rather than Blockly.getMainWorkspace().

* Make workspace required for resizeSvgContents and update
some calls to send real workspaces rather than ones that are
null.

Remove the private tag on terminateDrag_ because it is only
actually called from outside the BlockSvg object.

* Remove a rogue period.

* Recategorize BlockSvg.terminateDrag_ to @package instead of @private so that
other developers don't use it, but it still can be used by other Blockly classes.

* Add a TODO to fix issue .

* Add @package to workspace resizeContents.
2016-06-03 16:11:55 -07:00
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Neil Fraser
0242238a44 Remove sound and animation on delete during undo/redo. 2016-05-21 06:14:33 -07:00
Neil Fraser
006bb36b89 Prevent sounds from playing on top of each other. 2016-05-21 05:55:24 -07:00
Neil Fraser
29e10e0976 Routine recompile. 2016-05-14 03:50:35 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -07:00
Rachel Fenichel
32eed0d2f8 Merge branch 'develop' into cleanup/lint 2016-05-10 14:43:09 -07:00
Rachel Fenichel
3605dfb9c0 Undo decimation of variable redeclarations 2016-05-10 14:40:48 -07:00
Rachel Fenichel
640b38f38e lint 2016-05-05 13:13:48 -07:00
Katelyn Mann
ca16d1fefe An alternate (and less expensive) way to keep stuff outside of the blockly div
from getting selected. Use e.preventDefault instead of adding and removing
classes on mousedown and mouseup.  This keeps the browser from having to
potentially recacluate style on mousedown and mouseup events.
2016-05-04 19:12:38 -07:00
Neil Fraser
217c681b86 Use direct call to svg resize rather than event. Also fix issue . 2016-05-04 15:00:57 -07:00
Neil Fraser
554fe18ab9 Use direct call to comment's resize rather than event. 2016-05-04 14:49:00 -07:00
Rachel Fenichel
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07:00
Neil Fraser
fd7d4a2bef Make scrollCenter public, remove zoomReset. 2016-04-21 04:52:43 -07:00
Neil Fraser
c785cabe40 Use more coordinates. 2016-04-19 23:24:42 -07:00