4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
14 Roo.tree.TreeDragZone = function(tree, config){
15 Roo.tree.TreeDragZone.superclass.constructor.call(this, tree.getTreeEl(), config);
19 Roo.extend(Roo.tree.TreeDragZone, Roo.dd.DragZone, {
23 onBeforeDrag : function(data, e){
25 return n && n.draggable && !n.disabled;
28 onDragOut : function(e, id)
30 var ret = Roo.tree.TreeDragZone.superclass.constructor.prototype.onDragOut.call(this, e, id);
37 onDragEnter : function(e, id)
39 var ret = Roo.tree.TreeDragZone.superclass.constructor.prototype.onDragEnter.call(this, e, id);
41 if (this.scroller !== false) {
42 window.clearTimeout(this.scroller);
47 Roo.log('ondrageneter');
54 onInitDrag : function(e){
55 var data = this.dragData;
56 this.tree.getSelectionModel().select(data.node);
57 this.proxy.update("");
58 data.node.ui.appendDDGhost(this.proxy.ghost.dom);
59 this.tree.fireEvent("startdrag", this.tree, data.node, e);
62 getRepairXY : function(e, data){
63 return data.node.ui.getDDRepairXY();
66 onEndDrag : function(data, e){
67 this.tree.fireEvent("enddrag", this.tree, data.node, e);
70 onValidDrop : function(dd, e, id){
71 this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e);
75 beforeInvalidDrop : function(e, id){
76 // this scrolls the original position back into view
77 var sm = this.tree.getSelectionModel();
79 sm.select(this.dragData.node);