4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-fx-target-ElementCSS'>/**
19 </span> * @class Ext.fx.target.ElementCSS
20 * @extends Ext.fx.target.Element
22 * This class represents a animation target for an {@link Ext.core.Element} that supports CSS
23 * based animation. In general this class will not be created directly, the {@link Ext.core.Element}
24 * will be passed to the animation and the appropriate target will be created.
26 Ext.define('Ext.fx.target.ElementCSS', {
28 /* Begin Definitions */
30 extend: 'Ext.fx.target.Element',
34 setAttr: function(targetData, isFirstFrame) {
40 ln = targetData.length,
50 for (i = 0; i < ln; i++) {
51 attrs = targetData[i];
52 duration = attrs.duration;
53 easing = attrs.easing;
56 if (Ext.Array.indexOf(cssArr.attrs, attr) == -1) {
57 cssArr.attrs.push(attr.replace(/[A-Z]/g, function(v) {
58 return '-' + v.toLowerCase();
60 cssArr.duration.push(duration + 'ms');
61 cssArr.easing.push(easing);
65 attributes = cssArr.attrs.join(',');
66 duration = cssArr.duration.join(',');
67 easing = cssArr.easing.join(', ');
68 for (i = 0; i < ln; i++) {
69 attrs = targetData[i].attrs;
71 ln2 = attrs[attr].length;
72 for (j = 0; j < ln2; j++) {
74 o[0].setStyle(Ext.supports.CSS3Prefix + 'TransitionProperty', isFirstFrame ? '' : attributes);
75 o[0].setStyle(Ext.supports.CSS3Prefix + 'TransitionDuration', isFirstFrame ? '' : duration);
76 o[0].setStyle(Ext.supports.CSS3Prefix + 'TransitionTimingFunction', isFirstFrame ? '' : easing);
77 o[0].setStyle(attr, o[1]);
79 // Must trigger reflow to make this get used as the start point for the transition that follows
81 o = o[0].dom.offsetWidth;
84 // Remove transition properties when completed.
85 o[0].on(Ext.supports.CSS3TransitionEnd, function() {
86 this.setStyle(Ext.supports.CSS3Prefix + 'TransitionProperty', null);
87 this.setStyle(Ext.supports.CSS3Prefix + 'TransitionDuration', null);
88 this.setStyle(Ext.supports.CSS3Prefix + 'TransitionTimingFunction', null);
89 }, o[0], { single: true });