Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / source / ShadowPool.html
1 <!DOCTYPE html>
2 <html>
3 <head>
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; }
10   </style>
11   <script type="text/javascript">
12     function highlight() {
13       document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
14     }
15   </script>
16 </head>
17 <body onload="prettyPrint(); highlight();">
18   <pre class="prettyprint lang-js"><span id='Ext-ShadowPool'>/**
19 </span> * @class Ext.ShadowPool
20  * @extends Object
21  * Private utility class that manages the internal Shadow cache
22  * @private
23  */
24 Ext.define('Ext.ShadowPool', {
25     singleton: true,
26     requires: ['Ext.core.DomHelper'],
27
28     markup: function() {
29         if (Ext.supports.CSS3BoxShadow) {
30             return '&lt;div class=&quot;' + Ext.baseCSSPrefix + 'css-shadow&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;';
31         } else if (Ext.isIE) {
32             return '&lt;div class=&quot;' + Ext.baseCSSPrefix + 'ie-shadow&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;';
33         } else {
34             return '&lt;div class=&quot;' + Ext.baseCSSPrefix + 'frame-shadow&quot; role=&quot;presentation&quot;&gt;' +
35                 '&lt;div class=&quot;xst&quot; role=&quot;presentation&quot;&gt;' +
36                     '&lt;div class=&quot;xstl&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
37                     '&lt;div class=&quot;xstc&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
38                     '&lt;div class=&quot;xstr&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
39                 '&lt;/div&gt;' +
40                 '&lt;div class=&quot;xsc&quot; role=&quot;presentation&quot;&gt;' +
41                     '&lt;div class=&quot;xsml&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
42                     '&lt;div class=&quot;xsmc&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
43                     '&lt;div class=&quot;xsmr&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
44                 '&lt;/div&gt;' +
45                 '&lt;div class=&quot;xsb&quot; role=&quot;presentation&quot;&gt;' +
46                     '&lt;div class=&quot;xsbl&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
47                     '&lt;div class=&quot;xsbc&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
48                     '&lt;div class=&quot;xsbr&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
49                 '&lt;/div&gt;' +
50             '&lt;/div&gt;';
51         }
52     }(),
53
54     shadows: [],
55
56     pull: function() {
57         var sh = this.shadows.shift();
58         if (!sh) {
59             sh = Ext.get(Ext.core.DomHelper.insertHtml(&quot;beforeBegin&quot;, document.body.firstChild, this.markup));
60             sh.autoBoxAdjust = false;
61         }
62         return sh;
63     },
64
65     push: function(sh) {
66         this.shadows.push(sh);
67     },
68     
69     reset: function() {
70         Ext.Array.each(this.shadows, function(shadow) {
71             shadow.remove();
72         });
73         this.shadows = [];
74     }
75 });</pre>
76 </body>
77 </html>