2 * @class Ext.panel.Proxy
4 * A custom drag proxy implementation specific to {@link Ext.panel.Panel}s. This class
5 * is primarily used internally for the Panel's drag drop implementation, and
6 * should never need to be created directly.
8 * @param panel The {@link Ext.panel.Panel} to proxy for
9 * @param config Configuration options
11 Ext.define('Ext.panel.Proxy', {
13 alternateClassName: 'Ext.dd.PanelProxy',
15 constructor: function(panel, config){
18 * @type Ext.panel.Panel
21 this.id = this.panel.id +'-ddproxy';
22 Ext.apply(this, config);
26 * @cfg {Boolean} insertProxy True to insert a placeholder proxy element
27 * while dragging the panel, false to drag with no proxy (defaults to true).
28 * Most Panels are not absolute positioned and therefore we need to reserve
34 setStatus: Ext.emptyFn,
41 * Gets the proxy's element
42 * @return {Element} The proxy's element
49 * Gets the proxy's ghost Panel
50 * @return {Panel} The proxy's ghost Panel
57 * Gets the proxy element. This is the element that represents where the
58 * Panel was before we started the drag operation.
59 * @return {Element} The proxy's element
75 // Unghost the Panel, do not move the Panel to where the ghost was
76 this.panel.unghost(null, false);
86 var panelSize = this.panel.getSize();
87 this.panel.el.setVisibilityMode(Ext.core.Element.DISPLAY);
88 this.ghost = this.panel.ghost();
89 if (this.insertProxy) {
90 // bc Panels aren't absolute positioned we need to take up the space
91 // of where the panel previously was
92 this.proxy = this.panel.el.insertSibling({cls: Ext.baseCSSPrefix + 'panel-dd-spacer'});
93 this.proxy.setSize(panelSize);
99 repair: function(xy, callback, scope) {
101 if (typeof callback == "function") {
102 callback.call(scope || this);
107 * Moves the proxy to a different position in the DOM. This is typically
108 * called while dragging the Panel to keep the proxy sync'd to the Panel's
110 * @param {HTMLElement} parentNode The proxy's parent DOM node
111 * @param {HTMLElement} before (optional) The sibling node before which the
112 * proxy should be inserted (defaults to the parent's last child if not
115 moveProxy : function(parentNode, before){
117 parentNode.insertBefore(this.proxy.dom, before);