🚧 Part cloning
This commit is contained in:
parent
9a60dc5756
commit
18cc30fe74
7 changed files with 90 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue