mirror of
https://github.com/konvajs/konva.git
synced 2025-04-24 19:03:56 +08:00
Bug fix for getAttr function
Now it permits to return user defined attributes which do not have a corresponding method, similar to setAttrs(config) that sets attributes as key-value whenever there is no method for the given key
This commit is contained in:
parent
a09908b4a5
commit
a71d3e1fa0
@ -168,7 +168,13 @@
|
||||
*/
|
||||
getAttr: function(attr) {
|
||||
var method = GET + Kinetic.Type._capitalize(attr);
|
||||
return this[method]();
|
||||
if(Kinetic.Type._isFunction(this[method])) {
|
||||
return this[method]();
|
||||
}
|
||||
// otherwise get directly
|
||||
else {
|
||||
return this.attrs[attr];
|
||||
}
|
||||
},
|
||||
/**
|
||||
* get attrs
|
||||
|
Loading…
Reference in New Issue
Block a user