Changed export format

This commit is contained in:
Devine Lu Linvega 2018-03-07 12:03:27 +13:00
parent 74e64f42e9
commit e2d06cd88e

View File

@ -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);