From e2d06cd88e5eecdd9a7aa5524580c51e2de3af82 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 7 Mar 2018 12:03:27 +1300 Subject: [PATCH] Changed export format --- desktop/sources/scripts/tool.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/desktop/sources/scripts/tool.js b/desktop/sources/scripts/tool.js index f04e708..4724d03 100644 --- a/desktop/sources/scripts/tool.js +++ b/desktop/sources/scripts/tool.js @@ -215,16 +215,17 @@ function Tool() dotgrid.draw(); } - this.export = function(target = this.layers) + this.export = function(target = {layers:this.layers,styles:this.styles}) { return JSON.stringify(copy(target), null, 2); } - this.replace = function(layers) + this.replace = function(dot) { - if(layers.length != 3){ console.log("Incompatible"); return; } + if(!dot.layers || dot.layers.length != 3){ console.log("Incompatible version"); return; } - this.layers = layers; + this.layers = dot.layers; + this.styles = dot.styles; this.clear(); dotgrid.draw(); dotgrid.history.push(this.layers);