This commit is contained in:
Eric Rowell
2014-01-20 23:56:35 -08:00
parent 6650733b0a
commit 99719bad44
2 changed files with 33 additions and 1 deletions

View File

@@ -971,7 +971,11 @@
val = attrs[key];
if (!type._isFunction(val) && !type._isElement(val) && !(type._isObject(val) && type._hasMethods(val))) {
getter = this[GET + Kinetic.Util._capitalize(key)];
defaultValue = getter ? getter.call({attrs: {}}) : null;
// remove attr value so that we can extract the default value from the getter
delete attrs[key];
defaultValue = getter ? getter.call(this) : null;
// restore attr value
attrs[key] = val;
if (defaultValue !== val) {
obj.attrs[key] = val;
}