mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
#660 Do not export default values
This commit is contained in:
@@ -799,8 +799,12 @@
|
|||||||
// serialize only attributes that are not function, image, DOM, or objects with methods
|
// serialize only attributes that are not function, image, DOM, or objects with methods
|
||||||
for(key in attrs) {
|
for(key in attrs) {
|
||||||
val = attrs[key];
|
val = attrs[key];
|
||||||
if(!type._isFunction(val) && !type._isElement(val) && !(type._isObject(val) && type._hasMethods(val))) {
|
if (!type._isFunction(val) && !type._isElement(val) && !(type._isObject(val) && type._hasMethods(val))) {
|
||||||
obj.attrs[key] = val;
|
var getter = this[GET + Kinetic.Util._capitalize(key)];
|
||||||
|
var defaultValue = null == getter ? null : getter.call({attrs: {}});
|
||||||
|
if (defaultValue != val) {
|
||||||
|
obj.attrs[key] = val;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user