mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Add no-op stub .neighbors() for headless Connection.
This commit is contained in:
@@ -330,6 +330,7 @@ Blockly.Block.prototype.lastConnectionInStack_ = function() {
|
||||
* connected should not coincidentally line up on screen.
|
||||
* @private
|
||||
*/
|
||||
// TODO: Refactor to return early in headless mode.
|
||||
Blockly.Block.prototype.bumpNeighbours_ = function() {
|
||||
if (!this.workspace) {
|
||||
return; // Deleted block.
|
||||
|
||||
@@ -622,6 +622,22 @@ Blockly.Connection.prototype.getShadowDom = function() {
|
||||
return this.shadowDom_;
|
||||
};
|
||||
|
||||
/**
|
||||
* Find all nearby compatible connections to this connection.
|
||||
* Type checking does not apply, since this function is used for bumping.
|
||||
*
|
||||
* Headless configurations (the default) do not have neighboring connection,
|
||||
* and always return an empty list (the default).
|
||||
* {@link Blockly.RenderedConnection} overrides this behavior with a list
|
||||
* computed from the rendered positioning.
|
||||
* @param {number} maxLimit The maximum radius to another connection.
|
||||
* @return {!Array.<!Blockly.Connection>} List of connections.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Connection.prototype.neighbours_ = function(/* maxLimit */) {
|
||||
return [];
|
||||
};
|
||||
|
||||
/**
|
||||
* This method returns a string describing this Connection in developer terms
|
||||
* (English only). Intended to on be used in console logs and errors.
|
||||
|
||||
Reference in New Issue
Block a user