From a71d3e1fa0c2a48c97a9dd0838de545a659f5c7a Mon Sep 17 00:00:00 2001 From: aniruddha-loya Date: Wed, 24 Apr 2013 10:19:41 +0300 Subject: [PATCH] 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 --- src/Node.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Node.js b/src/Node.js index 747f79ab..8daf2354 100644 --- a/src/Node.js +++ b/src/Node.js @@ -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