Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconnects child blocks when an undo is done on an else block #2167

Merged
merged 2 commits into from Dec 13, 2018

Conversation

alschmiedt
Copy link
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

#2037

Proposed Changes

Reconnects the children of an if/else block after an undo is made.

Reason for Changes

screen shot 2018-12-13 at 9 16 25 am
Before Undo

screen shot 2018-12-13 at 9 16 31 am
After Undo

When a user tries to undo adding an else block it rebuilds the if/else block by removing all inputs and reconstructing with the appropriate number of elseif and else inputs. When removing the inputs it disconnects any statements attached to the inputs.

Test Coverage

Tested on:
Desktop Chrome
Desktop Firefox
Desktop Opera

Additional Information

Copy link
Contributor

@RoboErikG RoboErikG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit on comments, otherwise lgtm.

blocks/logic.js Outdated
@@ -425,6 +422,30 @@ Blockly.Constants.Logic.CONTROLS_IF_MUTATOR_MIXIN = {
clauseBlock.nextConnection.targetBlock();
}
},
/**
* Reconstructs the block with all child blocks attached.
* Fixes issue #2037.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need this comment about which issue the code fixes.

@alschmiedt alschmiedt merged commit 0c66429 into google:develop Dec 13, 2018
@alschmiedt alschmiedt deleted the mutation_actions branch June 10, 2019 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants