mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
[WIP] Fix element reordering without canvas
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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':
|
||||
|
||||
Reference in New Issue
Block a user