mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Speed up rendering by defering connection database construction.
This commit is contained in:
10
core/xml.js
10
core/xml.js
@@ -254,9 +254,13 @@ Blockly.Xml.domToBlock = function(workspace, xmlBlock, opt_reuseBlock) {
|
||||
for (var i = blocks.length - 1; i >= 0; i--) {
|
||||
blocks[i].render(false);
|
||||
}
|
||||
for (var i = blocks.length - 1; i >= 0; i--) {
|
||||
blocks[i].setConnectionsHidden(false);
|
||||
}
|
||||
// Populating the connection database may be defered until after the blocks
|
||||
// have renderend.
|
||||
window.setTimeout(function() {
|
||||
for (var i = blocks.length - 1; i >= 0; i--) {
|
||||
blocks[i].setConnectionsHidden(false);
|
||||
}
|
||||
}, 1);
|
||||
topBlock.updateDisabled();
|
||||
// Fire an event to allow scrollbars to resize.
|
||||
Blockly.fireUiEvent(window, 'resize');
|
||||
|
||||
Reference in New Issue
Block a user