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; }
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> * A custom drag proxy implementation specific to {@link Ext.panel.Panel}s. This class
20 * is primarily used internally for the Panel's drag drop implementation, and
21 * should never need to be created directly.
24 Ext.define('Ext.panel.Proxy', {
26 alternateClassName: 'Ext.dd.PanelProxy',
28 <span id='Ext-panel-Proxy-method-constructor'> /**
29 </span> * Creates new panel proxy.
30 * @param {Ext.panel.Panel} panel The {@link Ext.panel.Panel} to proxy for
31 * @param {Object} [config] Config object
33 constructor: function(panel, config){
34 <span id='Ext-panel-Proxy-property-panel'> /**
35 </span> * @property panel
36 * @type Ext.panel.Panel
39 this.id = this.panel.id +'-ddproxy';
40 Ext.apply(this, config);
43 <span id='Ext-panel-Proxy-cfg-insertProxy'> /**
44 </span> * @cfg {Boolean} insertProxy
45 * True to insert a placeholder proxy element while dragging the panel, false to drag with no proxy.
46 * Most Panels are not absolute positioned and therefore we need to reserve this space.
51 setStatus: Ext.emptyFn,
57 <span id='Ext-panel-Proxy-method-getEl'> /**
58 </span> * Gets the proxy's element
59 * @return {Ext.Element} The proxy's element
65 <span id='Ext-panel-Proxy-method-getGhost'> /**
66 </span> * Gets the proxy's ghost Panel
67 * @return {Ext.panel.Panel} The proxy's ghost Panel
73 <span id='Ext-panel-Proxy-method-getProxy'> /**
74 </span> * Gets the proxy element. This is the element that represents where the
75 * Panel was before we started the drag operation.
76 * @return {Ext.Element} The proxy's element
82 <span id='Ext-panel-Proxy-method-hide'> /**
83 </span> * Hides the proxy
92 // Unghost the Panel, do not move the Panel to where the ghost was
93 this.panel.unghost(null, false);
98 <span id='Ext-panel-Proxy-method-show'> /**
99 </span> * Shows the proxy
103 var panelSize = this.panel.getSize();
104 this.panel.el.setVisibilityMode(Ext.Element.DISPLAY);
105 this.ghost = this.panel.ghost();
106 if (this.insertProxy) {
107 // bc Panels aren't absolute positioned we need to take up the space
108 // of where the panel previously was
109 this.proxy = this.panel.el.insertSibling({cls: Ext.baseCSSPrefix + 'panel-dd-spacer'});
110 this.proxy.setSize(panelSize);
116 repair: function(xy, callback, scope) {
118 if (typeof callback == "function") {
119 callback.call(scope || this);
123 <span id='Ext-panel-Proxy-method-moveProxy'> /**
124 </span> * Moves the proxy to a different position in the DOM. This is typically
125 * called while dragging the Panel to keep the proxy sync'd to the Panel's
127 * @param {HTMLElement} parentNode The proxy's parent DOM node
128 * @param {HTMLElement} [before] The sibling node before which the
129 * proxy should be inserted (defaults to the parent's last child if not
132 moveProxy : function(parentNode, before){
134 parentNode.insertBefore(this.proxy.dom, before);