mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
Merge pull request #661 from blabno/do-not-export-default-values
#660 Do not export default values
This commit is contained in:
@@ -799,10 +799,14 @@
|
|||||||
// 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))) {
|
||||||
|
var getter = this[GET + Kinetic.Util._capitalize(key)];
|
||||||
|
var defaultValue = null == getter ? null : getter.call({attrs: {}});
|
||||||
|
if (defaultValue != val) {
|
||||||
obj.attrs[key] = val;
|
obj.attrs[key] = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
obj.className = this.getClassName();
|
obj.className = this.getClassName();
|
||||||
return obj;
|
return obj;
|
||||||
|
|||||||
Reference in New Issue
Block a user