Properly fix issue with Project#exportJSON() creating separate projects on import.

This commit is contained in:
Jürg Lehni 2013-05-28 07:42:38 -07:00
parent 612cf396cf
commit 0b4bc678bc
2 changed files with 6 additions and 6 deletions
src/project

View file

@ -69,7 +69,7 @@ var Project = PaperScopeItem.extend(/** @lends Project# */{
// into the active project automatically. We might want to add proper
// project serialization later, but deserialization of a layers array
// will always work.
return Base.serialize(this.layers, options, false, dictionary);
return Base.serialize(this.layers, options, true, dictionary);
},
/**
@ -266,10 +266,6 @@ 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];
this.activate();
return Base.importJSON(json);
},