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.1
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
17 isCSS1 = doc.compatMode == "CSS1Compat",
23 isAncestor : function(p, c) {
31 } else if (p.compareDocumentPosition) {
32 return !!(p.compareDocumentPosition(c) & 16);
34 while (c = c.parentNode) {
42 getViewWidth : function(full) {
43 return full ? this.getDocumentWidth() : this.getViewportWidth();
46 getViewHeight : function(full) {
47 return full ? this.getDocumentHeight() : this.getViewportHeight();
50 getDocumentHeight: function() {
51 return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight());
54 getDocumentWidth: function() {
55 return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth());
58 getViewportHeight: function(){
60 (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) :
64 getViewportWidth : function() {
65 return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth :
66 Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth;
70 return this.getXY(el)[1];
74 return this.getXY(el)[0];
77 getXY : function(el) {
88 bd = (doc.body || doc.documentElement),
94 if (el.getBoundingClientRect) {
95 b = el.getBoundingClientRect();
96 scroll = fly(document).getScroll();
97 ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)];
100 hasAbsolute = fly(el).isStyle("position", "absolute");
107 hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute");
110 y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0;
111 x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0;
113 if (p != el && !pe.isStyle('overflow','visible')) {
121 if (Ext.isSafari && hasAbsolute) {
126 if (Ext.isGecko && !hasAbsolute) {
128 x += PARSEINT(dbd.getStyle("borderLeftWidth"), 10) || 0;
129 y += PARSEINT(dbd.getStyle("borderTopWidth"), 10) || 0;
133 while (p && p != bd) {
134 if (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) {
146 setXY : function(el, xy) {
147 (el = Ext.fly(el, '_setXY')).position();
149 var pts = el.translatePoints(xy),
150 style = el.dom.style,
154 if(!isNaN(pts[pos])) style[pos] = pts[pos] + "px"
158 setX : function(el, x) {
159 this.setXY(el, [x, false]);
162 setY : function(el, y) {
163 this.setXY(el, [false, y]);