Unbox project data in Project#importJSON(), as we don't want to create a new project object.

This commit is contained in:
Jürg Lehni 2013-05-27 23:43:24 -07:00
parent 4e6f52c20c
commit 85920bbdb8

View file

@ -266,6 +266,10 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
// DOCS: Figure out a way to group these together with importSVG / exportSVG
importJSON: function(json) {
json = typeof json === 'string' ? JSON.parse(json) : json;
// Unbox project data, as we don't want to create a new project object.
if (json[0] === 'Project')
json = json[1];
return Base.importJSON(json);
},