3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.2.0
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
18 Ext.Element.addMethods(
20 var VISIBILITY = "visibility",
25 XMASKEDRELATIVE = "x-masked-relative",
26 data = Ext.Element.data;
29 <div id="method-Ext.Element-isVisible"></div>/**
30 * Checks whether the element is currently visible using both visibility and display properties.
31 * @param {Boolean} deep (optional) True to walk the dom and see if parent elements are hidden (defaults to false)
32 * @return {Boolean} True if the element is currently visible, else false
34 isVisible : function(deep) {
35 var vis = !this.isStyle(VISIBILITY,HIDDEN) && !this.isStyle(DISPLAY,NONE),
36 p = this.dom.parentNode;
37 if(deep !== true || !vis){
40 while(p && !/^body/i.test(p.tagName)){
41 if(!Ext.fly(p, '_isVisible').isVisible()){
49 <div id="method-Ext.Element-isDisplayed"></div>/**
50 * Returns true if display is not "none"
53 isDisplayed : function() {
54 return !this.isStyle(DISPLAY, NONE);
57 <div id="method-Ext.Element-enableDisplayMode"></div>/**
58 * Convenience method for setVisibilityMode(Element.DISPLAY)
59 * @param {String} display (optional) What to set display to when visible
60 * @return {Ext.Element} this
62 enableDisplayMode : function(display){
63 this.setVisibilityMode(Ext.Element.DISPLAY);
64 if(!Ext.isEmpty(display)){
65 data(this.dom, 'originalDisplay', display);
70 <div id="method-Ext.Element-mask"></div>/**
71 * Puts a mask over this element to disable user interaction. Requires core.css.
72 * This method can only be applied to elements which accept child nodes.
73 * @param {String} msg (optional) A message to display in the mask
74 * @param {String} msgCls (optional) A css class to apply to the msg element
75 * @return {Element} The mask element
77 mask : function(msg, msgCls){
81 EXTELMASKMSG = "ext-el-mask-msg",
85 if(!/^body/i.test(dom.tagName) && me.getStyle('position') == 'static'){
86 me.addClass(XMASKEDRELATIVE);
88 if((el = data(dom, 'maskMsg'))){
91 if((el = data(dom, 'mask'))){
95 mask = dh.append(dom, {cls : "ext-el-mask"}, true);
96 data(dom, 'mask', mask);
99 mask.setDisplayed(true);
100 if(typeof msg == 'string'){
101 var mm = dh.append(dom, {cls : EXTELMASKMSG, cn:{tag:'div'}}, true);
102 data(dom, 'maskMsg', mm);
103 mm.dom.className = msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG;
104 mm.dom.firstChild.innerHTML = msg;
105 mm.setDisplayed(true);
108 if(Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto'){ // ie will not expand full height automatically
109 mask.setSize(undefined, me.getHeight());
114 <div id="method-Ext.Element-unmask"></div>/**
115 * Removes a previously applied mask.
120 mask = data(dom, 'mask'),
121 maskMsg = data(dom, 'maskMsg');
125 data(dom, 'maskMsg', undefined);
128 data(dom, 'mask', undefined);
130 me.removeClass([XMASKED, XMASKEDRELATIVE]);
133 <div id="method-Ext.Element-isMasked"></div>/**
134 * Returns true if this element is masked
137 isMasked : function(){
138 var m = data(this.dom, 'mask');
139 return m && m.isVisible();
142 <div id="method-Ext.Element-createShim"></div>/**
143 * Creates an iframe shim for this element to keep selects and other windowed objects from
145 * @return {Ext.Element} The new shim element
147 createShim : function(){
148 var el = document.createElement('iframe'),
150 el.frameBorder = '0';
151 el.className = 'ext-shim';
152 el.src = Ext.SSL_SECURE_URL;
153 shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom));
154 shim.autoBoxAdjust = false;