mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Speed up rendering by defering connection database construction.
This commit is contained in:
parent
03e53d2d68
commit
69ffae6466
2 changed files with 8 additions and 4 deletions
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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue