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; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-panel-Proxy'>/**
19 </span> * @class Ext.panel.Proxy
21 * A custom drag proxy implementation specific to {@link Ext.panel.Panel}s. This class
22 * is primarily used internally for the Panel's drag drop implementation, and
23 * should never need to be created directly.
25 Ext.define('Ext.panel.Proxy', {
27 alternateClassName: 'Ext.dd.PanelProxy',
29 <span id='Ext-panel-Proxy-method-constructor'> /**
30 </span> * Creates new panel proxy.
31 * @param {Ext.panel.Panel} panel The {@link Ext.panel.Panel} to proxy for
32 * @param {Object} config (optional) Config object
34 constructor: function(panel, config){
35 <span id='Ext-panel-Proxy-property-panel'> /**
36 </span> * @property panel
37 * @type Ext.panel.Panel
40 this.id = this.panel.id +'-ddproxy';
41 Ext.apply(this, config);
44 <span id='Ext-panel-Proxy-cfg-insertProxy'> /**
45 </span> * @cfg {Boolean} insertProxy True to insert a placeholder proxy element
46 * while dragging the panel, false to drag with no proxy (defaults to true).
47 * Most Panels are not absolute positioned and therefore we need to reserve
53 setStatus: Ext.emptyFn,
59 <span id='Ext-panel-Proxy-method-getEl'> /**
60 </span> * Gets the proxy's element
61 * @return {Element} The proxy's element
67 <span id='Ext-panel-Proxy-method-getGhost'> /**
68 </span> * Gets the proxy's ghost Panel
69 * @return {Panel} The proxy's ghost Panel
75 <span id='Ext-panel-Proxy-method-getProxy'> /**
76 </span> * Gets the proxy element. This is the element that represents where the
77 * Panel was before we started the drag operation.
78 * @return {Element} The proxy's element
84 <span id='Ext-panel-Proxy-method-hide'> /**
85 </span> * Hides the proxy
94 // Unghost the Panel, do not move the Panel to where the ghost was
95 this.panel.unghost(null, false);
100 <span id='Ext-panel-Proxy-method-show'> /**
101 </span> * Shows the proxy
105 var panelSize = this.panel.getSize();
106 this.panel.el.setVisibilityMode(Ext.core.Element.DISPLAY);
107 this.ghost = this.panel.ghost();
108 if (this.insertProxy) {
109 // bc Panels aren't absolute positioned we need to take up the space
110 // of where the panel previously was
111 this.proxy = this.panel.el.insertSibling({cls: Ext.baseCSSPrefix + 'panel-dd-spacer'});
112 this.proxy.setSize(panelSize);
118 repair: function(xy, callback, scope) {
120 if (typeof callback == "function") {
121 callback.call(scope || this);
125 <span id='Ext-panel-Proxy-method-moveProxy'> /**
126 </span> * Moves the proxy to a different position in the DOM. This is typically
127 * called while dragging the Panel to keep the proxy sync'd to the Panel's
129 * @param {HTMLElement} parentNode The proxy's parent DOM node
130 * @param {HTMLElement} before (optional) The sibling node before which the
131 * proxy should be inserted (defaults to the parent's last child if not
134 moveProxy : function(parentNode, before){
136 parentNode.insertBefore(this.proxy.dom, before);