From 5a20678faa3858ac69ece7049cf824ce7b8f3db1 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Fri, 8 Aug 2014 12:21:06 +0200 Subject: don't drop custom block definitions when changing the language (fix #557) --- gui.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gui.js') 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(); -- cgit v1.3.1