cleaned up getLayer fix logic

This commit is contained in:
Eric Rowell
2013-11-27 08:24:47 -08:00
parent cbcd7d6c89
commit 1f6c8e7194

View File

@@ -829,11 +829,8 @@
* @memberof Kinetic.Node.prototype * @memberof Kinetic.Node.prototype
*/ */
getLayer: function() { getLayer: function() {
if (this.getParent()) { var parent = this.getParent();
return this.getParent().getLayer(); return parent ? parent.getLayer() : null;
} else {
return null;
}
}, },
/** /**
* get stage ancestor * get stage ancestor