Upgrade to ExtJS 4.0.7 - Released 10/19/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="../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; }
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> * Private utility class that manages the internal Shadow cache
20  * @private
21  */
22 Ext.define('Ext.ShadowPool', {
23     singleton: true,
24     requires: ['Ext.DomHelper'],
25
26     markup: function() {
27         if (Ext.supports.CSS3BoxShadow) {
28             return '&lt;div class=&quot;' + Ext.baseCSSPrefix + 'css-shadow&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;';
29         } else if (Ext.isIE) {
30             return '&lt;div class=&quot;' + Ext.baseCSSPrefix + 'ie-shadow&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;';
31         } else {
32             return '&lt;div class=&quot;' + Ext.baseCSSPrefix + 'frame-shadow&quot; role=&quot;presentation&quot;&gt;' +
33                 '&lt;div class=&quot;xst&quot; role=&quot;presentation&quot;&gt;' +
34                     '&lt;div class=&quot;xstl&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
35                     '&lt;div class=&quot;xstc&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
36                     '&lt;div class=&quot;xstr&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
37                 '&lt;/div&gt;' +
38                 '&lt;div class=&quot;xsc&quot; role=&quot;presentation&quot;&gt;' +
39                     '&lt;div class=&quot;xsml&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
40                     '&lt;div class=&quot;xsmc&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
41                     '&lt;div class=&quot;xsmr&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
42                 '&lt;/div&gt;' +
43                 '&lt;div class=&quot;xsb&quot; role=&quot;presentation&quot;&gt;' +
44                     '&lt;div class=&quot;xsbl&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
45                     '&lt;div class=&quot;xsbc&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
46                     '&lt;div class=&quot;xsbr&quot; role=&quot;presentation&quot;&gt;&lt;/div&gt;' +
47                 '&lt;/div&gt;' +
48             '&lt;/div&gt;';
49         }
50     }(),
51
52     shadows: [],
53
54     pull: function() {
55         var sh = this.shadows.shift();
56         if (!sh) {
57             sh = Ext.get(Ext.DomHelper.insertHtml(&quot;beforeBegin&quot;, document.body.firstChild, this.markup));
58             sh.autoBoxAdjust = false;
59         }
60         return sh;
61     },
62
63     push: function(sh) {
64         this.shadows.push(sh);
65     },
66     
67     reset: function() {
68         Ext.Array.each(this.shadows, function(shadow) {
69             shadow.remove();
70         });
71         this.shadows = [];
72     }
73 });</pre>
74 </body>
75 </html>