Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
7cac5feb
Commit
7cac5feb
authored
Nov 21, 2014
by
Neil Fraser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix illegal connections in stacks after a healing delete (issue 15).
parent
6e14380f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
128 additions
and
123 deletions
+128
-123
blockly_compressed.js
blockly_compressed.js
+1
-1
blockly_uncompressed.js
blockly_uncompressed.js
+126
-121
core/block.js
core/block.js
+1
-1
No files found.
blockly_compressed.js
View file @
7cac5feb
...
...
@@ -1013,7 +1013,7 @@ Blockly.BUMP_DELAY,a);Blockly.fireUiEvent(window,"resize")}a&&a.workspace.fireCh
Blockly.Block.prototype.unselect=function(){goog.asserts.assertObject(this.svg_,"Block is not rendered.");Blockly.selected=null;this.svg_.removeSelect();Blockly.fireUiEvent(this.workspace.getCanvas(),"blocklySelectChange")};
Blockly.Block.prototype.dispose=function(a,b,c){this.rendered=!1;this.unplug(a,!1);b&&this.svg_&&this.svg_.disposeUiEffect();this.workspace&&!c&&(this.workspace.removeTopBlock(this),this.workspace=null);Blockly.selected==this&&(Blockly.selected=null,Blockly.terminateDrag_());Blockly.ContextMenu.currentBlock==this&&Blockly.ContextMenu.hide();for(a=this.childBlocks_.length-1;0<=a;a--)this.childBlocks_[a].dispose(!1);b=this.getIcons();for(a=0;a<b.length;a++)b[a].dispose();for(a=0;b=this.inputList[a];a++)b.dispose();
this.inputList=[];b=this.getConnections_(!0);for(a=0;a<b.length;a++)c=b[a],c.targetConnection&&c.disconnect(),b[a].dispose();this.svg_&&(this.svg_.dispose(),this.svg_=null);Blockly.Realtime.isEnabled()&&!Blockly.Realtime.withinSync&&Blockly.Realtime.removeBlock(this)};
Blockly.Block.prototype.unplug=function(a,b){b=b&&!!this.getParent();if(this.outputConnection)this.outputConnection.targetConnection&&this.setParent(null);else{var c=null;this.previousConnection&&this.previousConnection.targetConnection&&(c=this.previousConnection.targetConnection,this.setParent(null));var d=this.getNextBlock();if(a&&d){var e=this.nextConnection.targetConnection;d.setParent(null);c&&c.connect(e)}}b&&this.moveBy(Blockly.SNAP_RADIUS*(Blockly.RTL?-1:1),2*Blockly.SNAP_RADIUS)};
Blockly.Block.prototype.unplug=function(a,b){b=b&&!!this.getParent();if(this.outputConnection)this.outputConnection.targetConnection&&this.setParent(null);else{var c=null;this.previousConnection&&this.previousConnection.targetConnection&&(c=this.previousConnection.targetConnection,this.setParent(null));var d=this.getNextBlock();if(a&&d){var e=this.nextConnection.targetConnection;d.setParent(null);c&&c.c
heckType_(e)&&c.c
onnect(e)}}b&&this.moveBy(Blockly.SNAP_RADIUS*(Blockly.RTL?-1:1),2*Blockly.SNAP_RADIUS)};
Blockly.Block.prototype.getRelativeToSurfaceXY=function(){var a=0,b=0;if(this.svg_){var c=this.svg_.getRootElement();do var d=Blockly.getRelativeXY_(c),a=a+d.x,b=b+d.y,c=c.parentNode;while(c&&c!=this.workspace.getCanvas())}return{x:a,y:b}};Blockly.Block.prototype.moveBy=function(a,b){var c=this.getRelativeToSurfaceXY();this.svg_.getRootElement().setAttribute("transform","translate("+(c.x+a)+", "+(c.y+b)+")");this.moveConnections_(a,b);Blockly.Realtime.blockChanged(this)};
Blockly.Block.prototype.getHeightWidth=function(){var a=this.svg_.height,b=this.svg_.width,c=this.getNextBlock();c&&(c=c.getHeightWidth(),a+=c.height-4,b=Math.max(b,c.width));return{height:a,width:b}};
Blockly.Block.prototype.onMouseDown_=function(a){if(!this.isInFlyout){Blockly.svgResize();Blockly.terminateDrag_();this.select();Blockly.hideChaff();if(Blockly.isRightButton(a))this.showContextMenu_(a);else if(this.isMovable()){Blockly.removeAllRanges();Blockly.setCursorHand_(!0);var b=this.getRelativeToSurfaceXY();this.startDragX=b.x;this.startDragY=b.y;this.startDragMouseX=a.clientX;this.startDragMouseY=a.clientY;Blockly.Block.dragMode_=1;Blockly.Block.onMouseUpWrapper_=Blockly.bindEvent_(document,
...
...
blockly_uncompressed.js
View file @
7cac5feb
This source diff could not be displayed because it is too large. You can
view the blob
instead.
core/block.js
View file @
7cac5feb
...
...
@@ -427,7 +427,7 @@ Blockly.Block.prototype.unplug = function(healStack, bump) {
// Disconnect the next statement.
var
nextTarget
=
this
.
nextConnection
.
targetConnection
;
nextBlock
.
setParent
(
null
);
if
(
previousTarget
)
{
if
(
previousTarget
&&
previousTarget
.
checkType_
(
nextTarget
)
)
{
// Attach the next statement to the previous statement.
previousTarget
.
connect
(
nextTarget
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment