diff --git a/src/item/Item.js b/src/item/Item.js index 64cb918d..b2726c67 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -306,7 +306,7 @@ var Item = this.Item = Base.extend(Callback, { } this._name = name || undefined; this._changed(/*#=*/ ChangeFlag.ATTRIBUTE); - } + }, /** * The path style of the item. @@ -364,6 +364,13 @@ var Item = this.Item = Base.extend(Callback, { * }); * path2.style = myStyle; */ + getStyle: function() { + return this._style; + }, + + setStyle: function(style) { + this._style.initialize(style); + } }, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'], // Produce getter/setters for properties. We need setters because we want to // call _changed() if a property was modified. diff --git a/src/style/Style.js b/src/item/Style.js similarity index 98% rename from src/style/Style.js rename to src/item/Style.js index 65f70b0a..b276ff54 100644 --- a/src/style/Style.js +++ b/src/item/Style.js @@ -158,15 +158,6 @@ var Style = this.Style = Base.extend(new function() { }; }); - // Define accessor on Item class for this style. - item.getStyle = function() { - return this._style; - }; - - item.setStyle = function(style) { - this._style.initialize(style); - }; - Item.inject(item); return fields; }, /** @lends Style# */{ diff --git a/src/paper.js b/src/paper.js index 9e5e959f..055b60c0 100644 --- a/src/paper.js +++ b/src/paper.js @@ -65,6 +65,7 @@ var paper = new function() { /*#*/ include('item/PlacedItem.js'); /*#*/ include('item/Raster.js'); /*#*/ include('item/PlacedSymbol.js'); +/*#*/ include('item/Style.js'); /*#*/ include('item/HitResult.js'); /*#*/ include('path/Segment.js'); @@ -81,8 +82,6 @@ var paper = new function() { /*#*/ include('text/TextItem.js'); /*#*/ include('text/PointText.js'); -/*#*/ include('style/Style.js'); - /*#*/ include('color/Color.js'); /*#*/ include('color/Gradient.js'); /*#*/ include('color/GradientStop.js');