summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2014-08-08 12:21:06 +0200
committerGubolin <gubolin@fantasymail.de>2014-08-08 12:21:06 +0200
commit5a20678faa3858ac69ece7049cf824ce7b8f3db1 (patch)
tree5eead6a2eb478b1dd5572542c238822d833bf318
parent0333925e916acc47c25cdcfec0c3be3d695a825f (diff)
downloadsnap-5a20678faa3858ac69ece7049cf824ce7b8f3db1.tar.gz
snap-5a20678faa3858ac69ece7049cf824ce7b8f3db1.zip
don't drop custom block definitions when changing the language (fix #557)
-rw-r--r--gui.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/gui.js b/gui.js
index 6af9137..9d6d952 100644
--- a/gui.js
+++ b/gui.js
@@ -3440,6 +3440,12 @@ IDE_Morph.prototype.reflectLanguage = function (lang, callback) {
projectData = this.serializer.serialize(this.stage);
}
}
+ this.world().children.forEach(function (morph) {
+ if (morph instanceof BlockEditorMorph) {
+ morph.updateDefinition(); // save custom blocks
+ // otherwise, initBlocks() will reset the definition
+ }
+ });
SpriteMorph.prototype.initBlocks();
this.spriteBar.tabBar.tabTo('scripts');
this.createCategories();