[WIP] Fix element reordering without canvas

This commit is contained in:
Evan W. Patton
2017-01-31 10:50:07 -05:00
parent f0f7128aff
commit 3891a185ef
2 changed files with 3 additions and 3 deletions

View File

@@ -292,7 +292,7 @@ Blockly.BlockSvg.prototype.setParent = function(newParent) {
return;
}
var svgRoot = this.getSvgRoot();
if (this.parentBlock_ && svgRoot) {
if (this.parentBlock_ && svgRoot && this.workspace.getCanvas()) {
// Move this block up the DOM. Keep track of x/y translations.
var xy = this.getRelativeToSurfaceXY();
this.workspace.getCanvas().appendChild(svgRoot);

View File

@@ -417,12 +417,12 @@ Blockly.Xml.domToBlockHeadless_ = function(xmlBlock, workspace) {
// Custom data for an advanced block.
if (block.domToMutation) {
block.domToMutation(xmlChild);
/* disabling due to this being _headless_
/* disabling due to this being _headless_
if (block.initSvg) {
// Mutation may have added some elements that need initalizing.
block.initSvg();
}
*/
*/
}
break;
case 'comment':