diff --git a/src/item/PathStyle.js b/src/item/PathStyle.js index 2bbb925e..a0654897 100644 --- a/src/item/PathStyle.js +++ b/src/item/PathStyle.js @@ -15,25 +15,6 @@ PathStyle = Base.extend(new function() { this[key] = style[key]; } } - }, - - _setChildrenStyle: function(name, value) { - for (var i = 0, l = this.item.children.length; i < l; i++) { - this.item.children[i].style[name] = value; - } - }, - - _getChildrenStyle: function(name) { - var style; - for (var i = 0, l = this.item.children.length; i < l; i++) { - if(!style) { - style = this.item.children[i].style[name]; - } else if(style != this.item.children[i].style[name]) { - // If there is another item with a different style: - return null; - } - } - return style; } } @@ -43,7 +24,9 @@ PathStyle = Base.extend(new function() { fields['set' + key.capitalize()] = function(value) { if(this.item && this.item.children) { - this._setChildrenStyle(key, value); + for (var i = 0, l = this.item.children.length; i < l; i++) { + this.item.children[i].style[key] = value; + } } else { this['_' + key] = value; } @@ -51,7 +34,16 @@ PathStyle = Base.extend(new function() { fields['get' + key.capitalize()] = function() { if(this.item && this.item.children) { - return this._getChildrenStyle(key); + var style; + for (var i = 0, l = this.item.children.length; i < l; i++) { + if(!style) { + style = this.item.children[i].style[key]; + } else if(style != this.item.children[i].style[key]) { + // If there is another item with a different style: + return null; + } + } + return style; } else { return this['_' + key]; }