* Stringify custom attributes-objects

* Stringify custom attributes-objects
This commit is contained in:
ada99
2016-07-09 16:54:28 +03:00
committed by Anton Lavrenov
parent 886d0c970e
commit 95edb44782
6 changed files with 123 additions and 18 deletions

View File

@@ -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.