3
* Copyright(c) 2006-2008, Ext JS, LLC.
6
* http://extjs.com/license
10
* @class Ext.dd.DragZone
11
* @extends Ext.dd.DragSource
12
* This class provides a container DD instance that proxies for multiple child node sources.<br />
13
* By default, this class requires that draggable child nodes are registered with {@link Ext.dd.Registry}.
15
* @param {Mixed} el The container element
16
* @param {Object} config
18
Ext.dd.DragZone = function(el, config){
19
Ext.dd.DragZone.superclass.constructor.call(this, el, config);
20
if(this.containerScroll){
21
Ext.dd.ScrollManager.register(this.el);
25
Ext.extend(Ext.dd.DragZone, Ext.dd.DragSource, {
27
* @cfg {Boolean} containerScroll True to register this container with the Scrollmanager
28
* for auto scrolling during drag operations.
31
* @cfg {String} hlColor The color to use when visually highlighting the drag source in the afterRepair
32
* method after a failed drop (defaults to "c3daf9" - light blue)
36
* Called when a mousedown occurs in this container. Looks in {@link Ext.dd.Registry}
37
* for a valid target to drag based on the mouse down. Override this method
38
* to provide your own lookup logic (e.g. finding a child by class name). Make sure your returned
39
* object has a "ddel" attribute (with an HTML Element) for other functions to work.
40
* @param {EventObject} e The mouse down event
41
* @return {Object} The dragData
43
getDragData : function(e){
44
return Ext.dd.Registry.getHandleFromEvent(e);
48
* Called once drag threshold has been reached to initialize the proxy element. By default, it clones the
50
* @param {Number} x The x position of the click on the dragged object
51
* @param {Number} y The y position of the click on the dragged object
52
* @return {Boolean} true to continue the drag, false to cancel
54
onInitDrag : function(x, y){
55
this.proxy.update(this.dragData.ddel.cloneNode(true));
56
this.onStartDrag(x, y);
61
* Called after a repair of an invalid drop. By default, highlights this.dragData.ddel
63
afterRepair : function(){
65
Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9");
67
this.dragging = false;
71
* Called before a repair of an invalid drop to get the XY to animate to. By default returns
72
* the XY of this.dragData.ddel
73
* @param {EventObject} e The mouse up event
74
* @return {Array} The xy location (e.g. [100, 200])
76
getRepairXY : function(e){
77
return Ext.Element.fly(this.dragData.ddel).getXY();
b'\\ No newline at end of file'