Commit Graph

120 Commits

Author SHA1 Message Date
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 #476.
2016-07-15 10:35:45 +02:00
Rodrigo Queiro
d3d0ca4fd0 Record whether the workspace has been dragged (#475)
* Record whether the workspace has been dragged

This fixes #473 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 (#474)
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
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 (#416)
This includes both block drags and workspace scrolls and fixes #404. 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 LLK/scratch-blocks#206.
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 #425. Attash the resize handler to the workspace so it can be removed (#429)
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. (#386)
* 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 #307.

* 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 #296. 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
Katelyn Mann
b69ab459bd Fix bad merge. Commit 36e0764e57 and e39a0b7069 collided on their use/removal of the event param to one of the zoom functions. 2016-04-18 16:53:32 -07:00
Neil Fraser
e08f0aa05b Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	core/workspace_svg.js
2016-04-14 00:25:25 -07:00
Neil Fraser
36e0764e57 Fix zoomToFit if there are no scrollbars. Issue #325. 2016-04-14 00:23:17 -07:00
Neil Fraser
701d828090 Merge pull request #329 from picklesrus/doubleclick
Add event preventDefault() calls to the end of zoom button handlers s…
2016-04-11 17:47:56 -07:00
Katelyn Mann
e39a0b7069 Add event preventDefault() calls to the end of zoom button handlers so the
browser doesn't try to handle them itself.  This keeps it from selecting text
on double clicks.
2016-04-11 15:33:05 -07:00
Neil Fraser
5e0c04dccd Merge branch 'master' into develop 2016-04-07 14:36:57 -07:00
rachel-fenichel
18a1550285 Horizontal toolbox layout with positioning at start or end. 2016-04-07 14:02:22 -07:00
rachel-fenichel
576830c309 Blockly.parseToolboxTree_ -> Blockly.Options.parseToolboxTree 2016-04-07 13:38:36 -07:00
Neil Fraser
61b3fbfe11 Move block database to workspace. 2016-04-05 18:43:39 -07:00
Neil Fraser
4e42a1b78e Swap order of arguments on domToWorkspace. 2016-04-04 18:31:41 -07:00
rachel-fenichel
e2f1a6c843 Fix annotations 2016-03-29 14:26:56 -07:00
Neil Fraser
ac0b5e7871 Use ENUM for dragMode. Blocks no longer sticky when created from disappearing flyout. 2016-03-29 08:36:11 -07:00
Neil Fraser
92f224dd52 Merge pull request #297 from picklesrus/develop-perf-1
Remove Blockly.removeAllRanges and replace it with calls to add/remove
2016-03-28 12:17:11 -07:00
Katelyn Mann
b11bd4fb71 Remove Blockly.removeAllRanges and replace it with calls to add/remove
css to mark text as unselectable instead.  I can't prove this is
significantly faster with numbers since the call to setup the time out
costs ~.1ms and the call when the timer fires is ~.05.  This happens on almost
every mouse event though.  Plus, it seems to remove a flicker of highlighting when
frames are skipped and keeps scrolling via the scrollbar from highlighting.
2016-03-28 10:06:43 -07:00
Neil Fraser
65a25ffb7e Don't offer to cleanup blocks in non-scrolling workspace. 2016-03-24 21:31:13 -07:00
Neil Fraser
d086634394 Lint and recompile. 2016-03-18 15:19:26 -07:00
Neil Fraser
a7892d1aee Raise error if statement block returns tuple. 2016-03-18 14:17:31 -07:00
Neil Fraser
6ae436a153 Add undo/redo context menu options on workspace. 2016-03-17 14:44:26 -07:00
Neil Fraser
8fb1178ed8 Update message descriptions. 2016-03-14 16:00:25 -07:00
Neil Fraser
06ff90bcaf Merge pull request #274 from picklesrus/bbox-develop
Replace the call to getBBox() in getMainWorkspaceMetrics
2016-03-11 14:24:01 -08:00
rachel-fenichel
f978826f77 Require ConnectionDB where needed; recompile 2016-03-11 12:16:25 -08:00