4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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-Queue'>/**
19 </span> * @class Ext.fx.Queue
20 * Animation Queue mixin to handle chaining and queueing by target.
24 Ext.define('Ext.fx.Queue', {
26 requires: ['Ext.util.HashMap'],
28 constructor: function() {
29 this.targets = Ext.create('Ext.util.HashMap');
34 getFxDefaults: function(targetId) {
35 var target = this.targets.get(targetId);
37 return target.fxDefaults;
43 setFxDefaults: function(targetId, obj) {
44 var target = this.targets.get(targetId);
46 target.fxDefaults = Ext.apply(target.fxDefaults || {}, obj);
51 stopAnimation: function(targetId) {
53 queue = me.getFxQueue(targetId),
61 <span id='Ext-fx-Queue-method-getActiveAnimation'> /**
63 * Returns current animation object if the element has any effects actively running or queued, else returns false.
65 getActiveAnimation: function(targetId) {
66 var queue = this.getFxQueue(targetId);
67 return (queue && !!queue.length) ? queue[0] : false;
71 hasFxBlock: function(targetId) {
72 var queue = this.getFxQueue(targetId);
73 return queue && queue[0] && queue[0].block;
76 // @private get fx queue for passed target, create if needed.
77 getFxQueue: function(targetId) {
82 queue = me.fxQueue[targetId],
83 target = me.targets.get(targetId);
90 me.fxQueue[targetId] = [];
91 // GarbageCollector will need to clean up Elements since they aren't currently observable
92 if (target.type != 'element') {
93 target.target.on('destroy', function() {
94 me.fxQueue[targetId] = [];
98 return me.fxQueue[targetId];
102 queueFx: function(anim) {
104 target = anim.target,
111 queue = me.getFxQueue(target.getId());
115 if (anim.concurrent) {
119 queue[ln - 1].on('afteranimate', function() {
127 anim.on('afteranimate', function() {
128 Ext.Array.remove(queue, anim);
130 if (target.type == 'element') {
131 var el = Ext.get(target.id);