mirror of
https://github.com/konvajs/konva.git
synced 2025-12-17 18:01:15 +08:00
* Stringify custom attributes-objects * Stringify custom attributes-objects
This commit is contained in:
@@ -1169,11 +1169,6 @@
|
||||
|
||||
for(key in attrs) {
|
||||
val = attrs[key];
|
||||
// serialize only attributes that are not function, image, DOM, or objects with methods
|
||||
if (Konva.Util._isFunction(val) || Konva.Util._isElement(val) ||
|
||||
(Konva.Util._isObject(val) || Konva.Util._hasMethods(val))) {
|
||||
continue;
|
||||
}
|
||||
getter = this[key];
|
||||
// remove attr value so that we can extract the default value from the getter
|
||||
delete attrs[key];
|
||||
@@ -1186,7 +1181,7 @@
|
||||
}
|
||||
|
||||
obj.className = this.getClassName();
|
||||
return obj;
|
||||
return Konva.Util._prepareToStringify(obj);
|
||||
},
|
||||
/**
|
||||
* convert Node into a JSON string. Returns a JSON string.
|
||||
|
||||
Reference in New Issue
Block a user