jquery removed

This commit is contained in:
tamat
2013-10-24 19:44:48 +02:00
parent 2b3503640e
commit 84377376a9
4 changed files with 29 additions and 17 deletions

View File

@@ -116,7 +116,7 @@ var LiteGraph = {
if( prototype[i].concat ) //array
node[i] = prototype[i].concat();
else if (typeof(prototype[i]) == 'object')
node[i] = jQuery.extend({}, prototype[i]);
node[i] = LiteGraph.cloneObject(prototype[i]); //slow but safe
else
node[i] = prototype[i];
}
@@ -248,6 +248,12 @@ var LiteGraph = {
if(LiteGraph.debug)
console.log("Nodes reloaded");
},
//separated just to improve if it doesnt work
cloneObject: function(obj)
{
return JSON.parse( JSON.stringify( obj ) );
}
/*
@@ -985,8 +991,8 @@ LGraphNode.prototype.objectivize = function()
pos: this.pos,
size: this.size,
data: this.data,
properties: jQuery.extend({}, this.properties),
flags: jQuery.extend({}, this.flags),
properties: LiteGraph.cloneObject(this.properties),
flags: LiteGraph.cloneObject(this.flags),
inputs: this.inputs,
outputs: this.outputs
};
@@ -1436,7 +1442,7 @@ LGraphNode.prototype.copyFromObject = function(info, ignore_connections)
else if( info[j].concat ) //array
this[j] = info[j].concat();
else if (typeof(info[j]) == 'object') //object
this[j] = jQuery.extend({}, info[j]);
this[j] = LiteGraph.cloneObject(info[j]);
else //value
this[j] = info[j];
}