Allow scrolling Top Instructions despite Blockly Blocks#9753
Merged
Hamms merged 5 commits intoAug 1, 2016
Conversation
Formerly, blockly blocks which appear in Top Instructions were capturing mousewheel events and preventing scrolling when the mouse was within their blockspace. Now that all ReadOnly blockspaces are being precisely sized to fit their contents, scrolling readonly blockspaces is unnecessary and their ability to scroll can safely be removed.
| if (opt_options.noScrolling) { | ||
| blockSpace.scrollbarPair.dispose(); | ||
| blockSpace.scrollbarPair = null; | ||
| } |
Contributor
There was a problem hiding this comment.
Should we somehow prevent this from being created in the first place, instead of destroying it right after creating the blockSpace here?
Contributor
Author
There was a problem hiding this comment.
I was debating. It comes down to whether we view these ReadOnly BlockSpaces as a core feature deserving of refactoring to support, or if it's more of a curiosity we simply make allowances for.
Contributor
There was a problem hiding this comment.
My instinct would be to make it a core feature; it doesn't sound that hard to do. 😉
Contributor
|
Test for the new |
… than several individual options arguments
…ce, rather than creating then immedidately destroying them
Contributor
Author
|
PTAL |
| } | ||
|
|
||
| function test_scrollingCapturesMouseWheelEvents() { | ||
| [true, false].forEach(function (scrollingEnabled) { |
Contributor
|
Beautiful! LGTM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formerly, blockly blocks which appear in Top Instructions were
capturing mousewheel events and preventing scrolling when the mouse was
within their blockspace. Now that all ReadOnly blockspaces are being
precisely sized to fit their contents, scrolling readonly blockspaces is
unnecessary and their ability to scroll can safely be removed.