mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Rebuild
This commit is contained in:
@@ -1097,10 +1097,9 @@ Blockly.RenderedConnection.prototype.closest=function(a,b){return this.dbOpposit
|
||||
Blockly.RenderedConnection.prototype.highlight=function(){var a=this.type==Blockly.INPUT_VALUE||this.type==Blockly.OUTPUT_VALUE?"m 0,0 "+Blockly.BlockSvg.TAB_PATH_DOWN+" v 5":"m -20,0 h 5 "+Blockly.BlockSvg.NOTCH_PATH_LEFT+" h 5";var b=this.sourceBlock_.getRelativeToSurfaceXY();Blockly.Connection.highlightedPath_=Blockly.utils.dom.createSvgElement("path",{"class":"blocklyHighlightedConnectionPath",d:a,transform:"translate("+(this.x_-b.x)+","+(this.y_-b.y)+")"+(this.sourceBlock_.RTL?" scale(-1 1)":
|
||||
"")},this.sourceBlock_.getSvgRoot())};
|
||||
Blockly.RenderedConnection.prototype.unhideAll=function(){this.setHidden(!1);var a=[];if(this.type!=Blockly.INPUT_VALUE&&this.type!=Blockly.NEXT_STATEMENT)return a;var b=this.targetBlock();if(b){if(b.isCollapsed()){var c=[];b.outputConnection&&c.push(b.outputConnection);b.nextConnection&&c.push(b.nextConnection);b.previousConnection&&c.push(b.previousConnection)}else c=b.getConnections_(!0);for(var d=0;d<c.length;d++)a.push.apply(a,c[d].unhideAll());a.length||(a[0]=b)}return a};
|
||||
Blockly.RenderedConnection.prototype.unhighlight=function(){Blockly.utils.dom.removeNode(Blockly.Connection.highlightedPath_);delete Blockly.Connection.highlightedPath_};Blockly.RenderedConnection.prototype.setHidden=function(a){(this.hidden_=a)&&this.inDB_?this.db_.removeConnection_(this):a||this.inDB_||this.db_.addConnection(this)};
|
||||
Blockly.RenderedConnection.prototype.unhighlight=function(){Blockly.utils.dom.removeNode(Blockly.Connection.highlightedPath_);delete Blockly.Connection.highlightedPath_};Blockly.RenderedConnection.prototype.setHidden=function(a){(this.hidden_=a)&&this.inDB_?this.db_.removeConnection_(this):a||this.inDB_||this.db_.addConnection(this);if(this.isSuperior()&&this.targetBlock()){var b=a?"none":"block",c=this.targetBlock();c.getSvgRoot().style.display=b;c.rendered=!a}};
|
||||
Blockly.RenderedConnection.prototype.hideAll=function(){this.setHidden(!0);if(this.targetConnection)for(var a=this.targetBlock().getDescendants(!1),b=0;b<a.length;b++){for(var c=a[b],d=c.getConnections_(!0),e=0;e<d.length;e++)d[e].setHidden(!0);c=c.getIcons();for(e=0;e<c.length;e++)c[e].setVisible(!1)}};Blockly.RenderedConnection.prototype.isConnectionAllowed=function(a,b){return this.distanceFrom(a)>b?!1:Blockly.RenderedConnection.superClass_.isConnectionAllowed.call(this,a)};
|
||||
Blockly.RenderedConnection.prototype.connect=function(a){Blockly.RenderedConnection.superClass_.connect.call(this,a);if(this.hidden_||a.hidden_){a=this.isSuperior()?this:a;a.hidden_?a.hideAll():a.unhideAll();var b=a.targetBlock(),c=a.hidden_?"none":"block";b.getSvgRoot().style.display=c;b.rendered=!a.hidden_}};
|
||||
Blockly.RenderedConnection.prototype.disconnect=function(){var a=this.isSuperior()?this:this.targetConnection;if(this.targetConnection&&a.hidden_){a.unhideAll();var b=a.targetBlock();b.getSvgRoot().style.display="block";b.rendered=!0;a.setHidden(!0)}Blockly.RenderedConnection.superClass_.disconnect.call(this)};
|
||||
Blockly.RenderedConnection.prototype.connect=function(a){Blockly.RenderedConnection.superClass_.connect.call(this,a);if(this.hidden_||a.hidden_)a=this.isSuperior()?this:a,a.hidden_?a.hideAll():a.unhideAll()};Blockly.RenderedConnection.prototype.disconnect=function(){var a=this.isSuperior()?this:this.targetConnection,b=!1;this.targetConnection&&a.hidden_&&(a.unhideAll(),b=!0);Blockly.RenderedConnection.superClass_.disconnect.call(this);b&&a.hideAll()};
|
||||
Blockly.RenderedConnection.prototype.disconnectInternal_=function(a,b){Blockly.RenderedConnection.superClass_.disconnectInternal_.call(this,a,b);a.rendered&&a.render();b.rendered&&(b.updateDisabled(),b.render())};
|
||||
Blockly.RenderedConnection.prototype.respawnShadow_=function(){var a=this.getSourceBlock(),b=this.getShadowDom();if(a.workspace&&b&&Blockly.Events.recordUndo){Blockly.RenderedConnection.superClass_.respawnShadow_.call(this);b=this.targetBlock();if(!b)throw Error("Couldn't respawn the shadow block that should exist here.");b.initSvg();b.render(!1);a.rendered&&!this.hidden_&&a.render()}};Blockly.RenderedConnection.prototype.neighbours_=function(a){return this.dbOpposite_.getNeighbours(this,a)};
|
||||
Blockly.RenderedConnection.prototype.connect_=function(a){Blockly.RenderedConnection.superClass_.connect_.call(this,a);var b=this.getSourceBlock();a=a.getSourceBlock();b.rendered&&b.updateDisabled();a.rendered&&a.updateDisabled();b.rendered&&a.rendered&&(this.type==Blockly.NEXT_STATEMENT||this.type==Blockly.PREVIOUS_STATEMENT?a.render():b.render())};
|
||||
|
||||
Reference in New Issue
Block a user