Commit graph

95 commits

Author SHA1 Message Date
Rodrigo Queiro
373b68d8b0 Add JSDoc for flyout drag state variables 2016-07-20 10:24:15 +02: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
Neil Fraser
e849c93db9 Merge branch 'master' into develop 2016-07-08 16:52:18 -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
0454c93ff8 Clean up after review 2016-06-29 12:26:11 +02:00
Rodrigo Queiro
4e3faf0158 Revise handling of mouse events on flyout blocks
- allows scrolling by dragging a block up and down
- dragging a block towards the workspace creates it
- dragging a block any direction in a non-scrollable flyout creates it
- dragging a shadow block works properly
- clicks on fields in non-closeable flyouts always open editors
- clicks in closeable flyouts create the block but don't open editors

Fixes  and fixes .
2016-06-29 11:29:03 +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
aca074891d Fix some problems with flyout rendering () 2016-06-27 17:27:08 -07:00
Rachel Fenichel
8f601345bb cache delete areas instead of recalculating them onMouseDown 2016-06-17 12:39:18 -07:00
picklesrus
33ba6e8fad Fix by calling workspace's resize when the flyout reflows. () 2016-06-14 10:13:03 -07:00
Rodrigo Queiro
0585a667ec Fix typo in flyout.js () 2016-06-07 09:54:57 -07:00
Rodrigo Queiro
736ff96ead Fix typo in flyout.js () 2016-06-07 09:54:37 -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
e14e42192c Merge pull request from rachel-fenichel/cleanup/more_lint
More lint and eslint configuration.
2016-05-25 15:36:03 -07:00
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Rachel Fenichel
6208ba62fb Rename a variable for clarity 2016-05-25 13:47:19 -07:00
Neil Fraser
29e10e0976 Routine recompile. 2016-05-14 03:50:35 -07:00
Rachel Fenichel
f38b43419c Combine horizontal and vertical flyout scrolling 2016-05-13 16:07:53 -07:00
Rachel Fenichel
65aceaa1dc Fix docstrings and add horizontal scrolling. 2016-05-13 15:30:47 -07:00
Rachel Fenichel
666536807a Add comments; scroll to start for always open flyout 2016-05-13 14:26:32 -07:00
Rachel Fenichel
8cfd48554a clean up margins 2016-05-11 16:40:42 -07:00
Rachel Fenichel
e0cda58701 fix variable naming in createnewblock. 2016-05-11 15:15:12 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44: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
Rachel Fenichel
8f51fb1e48 remove duplicate code 2016-05-02 15:23:02 -07:00
Rachel Fenichel
cb1188af45 Add TODOs 2016-04-27 10:31:01 -07:00
Rachel Fenichel
2591e12a46 Fix janky scrolling in vertical case 2016-04-26 18:16:26 -07:00
Rachel Fenichel
60dfbb455e offset correctly when opening for the first time 2016-04-26 15:10:49 -07:00
Rachel Fenichel
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07:00
Neil Fraser
6c0bf9f966 Routine recompile. 2016-04-21 06:05:25 -07:00
Neil Fraser
9e034b2716 Merge pull request from picklesrus/develop-hatblock
Take into account height of the hat for hat blocks.
2016-04-21 05:27:35 -07:00
Neil Fraser
e65d6964bd Merge pull request from rachel-fenichel/cleanup/flyout_listeners
Decompose functions in flyout.  Does not change behaviour.
2016-04-21 05:19:00 -07:00
Neil Fraser
703ac981da Routine recompile. 2016-04-20 16:44:13 -07:00
rachel-fenichel
c8f98a7ded Decompose functions in flyout. Does not change behaviour. 2016-04-20 14:14:53 -07:00
Neil Fraser
52eb6adcc2 Add click events to non-closing flyout blocks. Issue . 2016-04-20 05:03:05 -07:00
rachel-fenichel
ac15b8b179 Use Infinity instead of a large number 2016-04-19 14:37:50 -07:00
rachel-fenichel
8882c727a3 remove log statements 2016-04-19 14:27:13 -07:00
rachel-fenichel
84d2388add works in horizontal rtl! 2016-04-19 13:58:58 -07:00
rachel-fenichel
4fd9f096de decompose Blockly.Flyout.prototype.show 2016-04-14 13:21:35 -07:00
rachel-fenichel
a1509a4467 toolbox -> flyout 2016-04-14 12:50:10 -07:00
Neil Fraser
b5a2f75cee Add tooltips to input holes in flyout. 2016-04-13 15:54:05 -07:00
rachel-fenichel
21e999678c correctly position trash can and zoom controls when the flyout is always open; add flyout and toolbox size to main workspace metrics; get rid of flyout's vertical offset. 2016-04-13 15:30:11 -07:00
Katelyn Mann
79f91266ac Take into account height of the hat for hat blocks.
Also, position hat blocks correctly in the flyout/toolbox.
This fixes .
2016-04-12 14:59:58 -07:00
rachel-fenichel
01955c6615 lint 2016-04-12 13:14:49 -07:00
rachel-fenichel
7cf5de5774 Dragging out of flyout with zoom works for horizontal flyouts in LTR mode 2016-04-11 12:51:18 -07:00
rachel-fenichel
6202113237 fix accidental flyout scrolling 2016-04-08 15:34:08 -07:00
rachel-fenichel
a4bdede170 Fix scrollbar positioning and category ordering 2016-04-07 14:02:22 -07:00
rachel-fenichel
9d82bf3a18 lint 2016-04-07 14:02:22 -07:00
rachel-fenichel
18a1550285 Horizontal toolbox layout with positioning at start or end. 2016-04-07 14:02:22 -07:00