Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / src / fx / target / CompositeElement.js
1 /**
2  * @class Ext.fx.target.CompositeElement
3  * @extends Ext.fx.target.Element
4  * 
5  * This class represents a animation target for a {@link Ext.CompositeElement}. It allows
6  * each {@link Ext.core.Element} in the group to be animated as a whole. In general this class will not be
7  * created directly, the {@link Ext.CompositeElement} will be passed to the animation and
8  * and the appropriate target will be created.
9  */
10 Ext.define('Ext.fx.target.CompositeElement', {
11
12     /* Begin Definitions */
13
14     extend: 'Ext.fx.target.Element',
15
16     /* End Definitions */
17
18     isComposite: true,
19     
20     constructor: function(target) {
21         target.id = target.id || Ext.id(null, 'ext-composite-');
22         this.callParent([target]);
23     },
24
25     getAttr: function(attr, val) {
26         var out = [],
27             target = this.target;
28         target.each(function(el) {
29             out.push([el, this.getElVal(el, attr, val)]);
30         }, this);
31         return out;
32     }
33 });