1
0
Fork 0

🚧 Part cloning

This commit is contained in:
Joost De Cock 2018-08-03 14:20:28 +02:00
parent 9a60dc5756
commit 18cc30fe74
7 changed files with 90 additions and 3 deletions

View file

@ -48,4 +48,12 @@ attributes.prototype.renderIfPrefixIs = function(prefix = "") {
return svg;
};
/** Returns a deep copy of this */
attributes.prototype.clone = function() {
let clone = new attributes();
clone.list = JSON.parse(JSON.stringify(this.list));
return clone;
};
export default attributes;