From 85920bbdb81f1c20755dce15a24eec2977ddd3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Mon, 27 May 2013 23:43:24 -0700 Subject: [PATCH] Unbox project data in Project#importJSON(), as we don't want to create a new project object. --- src/project/Project.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/project/Project.js b/src/project/Project.js index 43f873e7..0932a174 100644 --- a/src/project/Project.js +++ b/src/project/Project.js @@ -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); },