Upgrade to ExtJS 4.0.1 - Released 05/18/2011
[extjs.git] / docs / source / Window-legacy.html
diff --git a/docs/source/Window-legacy.html b/docs/source/Window-legacy.html
new file mode 100644 (file)
index 0000000..e59eff8
--- /dev/null
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <title>The source code</title>
+  <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
+  <script type="text/javascript" src="../prettify/prettify.js"></script>
+  <style type="text/css">
+    .highlight { display: block; background-color: #ddd; }
+  </style>
+  <script type="text/javascript">
+    function highlight() {
+      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
+    }
+  </script>
+</head>
+<body onload="prettyPrint(); highlight();">
+  <pre class="prettyprint lang-js"><span id='Ext-Window'>/**
+</span> * @class Ext.Window
+ * @ignore
+ */
+Ext.Window.override({
+<span id='Ext-Window-method-anchorTo'>    /**
+</span>     * Anchors this window to another element and realigns it when the window is resized or scrolled.
+     * @param {Mixed} element The element to align to.
+     * @param {String} position The position to align to (see {@link Ext.core.Element#alignTo} for more details)
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @param {Boolean/Number} monitorScroll (optional) true to monitor body scroll and reposition. If this parameter
+     * is a number, it is used as the buffer delay (defaults to 50ms).
+     * @return {Ext.window.Window} this
+     */
+    anchorTo: function(el, alignment, offsets, monitorScroll) {
+        this.clearAnchor();
+        this.anchorTarget = {
+            el: el,
+            alignment: alignment,
+            offsets: offsets
+        };
+
+        Ext.EventManager.onWindowResize(this.doAnchor, this);
+        var tm = typeof monitorScroll;
+        if (tm != 'undefined') {
+            Ext.EventManager.on(window, 'scroll', this.doAnchor, this,
+            {
+                buffer: tm == 'number' ? monitorScroll: 50
+            });
+        }
+        return this.doAnchor();
+    },
+
+<span id='Ext-Window-method-doAnchor'>    /**
+</span>     * Performs the anchor, using the saved anchorTarget property.
+     * @return {Ext.window.Window} this
+     * @private
+     */
+    doAnchor: function() {
+        var o = this.anchorTarget;
+        this.alignTo(o.el, o.alignment, o.offsets);
+        return this;
+    },
+
+<span id='Ext-Window-method-clearAnchor'>    /**
+</span>     * Removes any existing anchor from this window. See {@link #anchorTo}.
+     * @return {Ext.window.Window} this
+     */
+    clearAnchor: function() {
+        if (this.anchorTarget) {
+            Ext.EventManager.removeResizeListener(this.doAnchor, this);
+            Ext.EventManager.un(window, 'scroll', this.doAnchor, this);
+            delete this.anchorTarget;
+        }
+        return this;
+    }
+});</pre>
+</body>
+</html>