Expose #className on all classes that define #_class

Closes #576
This commit is contained in:
Jürg Lehni 2014-11-30 11:13:51 -08:00
parent af1de8862c
commit c48f4d772e
2 changed files with 11 additions and 4 deletions

View file

@ -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.
*

View file

@ -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