Merge pull request #1429 from thomaswp/xml-parse-error-fix

Fixed #1428, an issue with preview the (empty) project placeholder.
dev
Jens Mönig 2016-10-16 17:30:06 +02:00 zatwierdzone przez GitHub
commit 9b6449c8f7
1 zmienionych plików z 12 dodań i 9 usunięć

21
gui.js
Wyświetl plik

@ -5507,16 +5507,19 @@ ProjectDialogMorph.prototype.setSource = function (source) {
if (myself.task === 'open') {
src = localStorage['-snap-project-' + item.name];
xml = myself.ide.serializer.parse(src);
myself.notesText.text = xml.childNamed('notes').contents
|| '';
myself.notesText.drawNew();
myself.notesField.contents.adjustBounds();
myself.preview.texture = xml.childNamed('thumbnail').contents
|| null;
myself.preview.cachedTexture = null;
myself.preview.drawNew();
if (src) {
xml = myself.ide.serializer.parse(src);
myself.notesText.text = xml.childNamed('notes').contents
|| '';
myself.notesText.drawNew();
myself.notesField.contents.adjustBounds();
myself.preview.texture =
xml.childNamed('thumbnail').contents || null;
myself.preview.cachedTexture = null;
myself.preview.drawNew();
}
}
myself.edit();
};