mirror of
https://github.com/google/blockly.git
synced 2026-01-11 10:57:07 +01:00
bringToFront optimization for large workspaces (#3214)
* bringToFront optimization for large workspaces
This commit is contained in:
@@ -1375,7 +1375,12 @@ Blockly.BlockSvg.prototype.bringToFront = function() {
|
||||
var block = this;
|
||||
do {
|
||||
var root = block.getSvgRoot();
|
||||
root.parentNode.appendChild(root);
|
||||
var parent = root.parentNode;
|
||||
var childNodes = parent.childNodes;
|
||||
// Avoid moving the block if it's already at the bottom.
|
||||
if (childNodes[childNodes.length - 1] !== root) {
|
||||
parent.appendChild(root);
|
||||
}
|
||||
block = block.getParent();
|
||||
} while (block);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user