From c48f4d772e5bcccc3a3d160f3975fa6c4bd1661e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ju=CC=88rg=20Lehni?= Date: Sun, 30 Nov 2014 11:13:51 -0800 Subject: [PATCH] Expose #className on all classes that define #_class Closes #576 --- src/core/Base.js | 10 ++++++++++ src/item/Item.js | 5 +---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/core/Base.js b/src/core/Base.js index 844dc280..208eacca 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -36,6 +36,16 @@ Base.inject(/** @lends Base# */{ }, []).join(', ') + ' }'; }, + /** + * The class name of the object as a string, if the prototype defines a + * `_class` value. + * + * @beans + */ + getClassName: function() { + return this._class || ''; + }, + /** * Serializes this object to a JSON string. * diff --git a/src/item/Item.js b/src/item/Item.js index fba42e92..aebd93e5 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -320,13 +320,10 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ /** * The class name of the item as a string. * + * @name Item#className * @type String('Group', 'Layer', 'Path', 'CompoundPath', 'Shape', * 'Raster', 'PlacedSymbol', 'PointText') - * @bean */ - getClassName: function() { - return this._class; - }, /** * The name of the item. If the item has a name, it can be accessed by name