9 * @class Roo.bootstrap.DropTarget
10 * @extends Roo.bootstrap.Element
11 * Bootstrap DropTarget class
13 * @cfg {string} name dropable name
16 * Create a new Dropable Area
17 * @param {Object} config The config object
20 Roo.bootstrap.DropTarget = function(config){
21 Roo.bootstrap.DropTarget.superclass.constructor.call(this, config);
27 * When a element is chick
28 * @param {Roo.bootstrap.Element} this
29 * @param {Roo.EventObject} e
35 Roo.extend(Roo.bootstrap.DropTarget, Roo.bootstrap.Element, {
38 getAutoCreate : function(){
43 initEvents: function()
45 Roo.bootstrap.DropTarget.superclass.initEvents.call(this);
46 this.dropZone = new Roo.dd.DropTarget(this.getEl(), {
49 drop : this.dragDrop.createDelegate(this),
50 enter : this.dragEnter.createDelegate(this),
51 out : this.dragOut.createDelegate(this),
52 over : this.dragOver.createDelegate(this)
56 this.dropZone.DDM.useCache = false // so data gets refreshed when we resize stuff
59 dragDrop : function(source,e,data)
61 // user has to decide how to impliment this.
64 //this.fireEvent('drop', this, source, e ,data);
68 dragEnter : function(n, dd, e, data)
70 // probably want to resize the element to match the dropped element..
72 this.originalSize = this.el.getSize();
73 this.el.setSize( n.el.getSize());
74 this.dropZone.DDM.refreshCache(this.name);
75 Roo.log([n, dd, e, data]);
78 dragOut : function(value)
80 // resize back to normal
82 this.el.setSize(this.originalSize);
83 this.dropZone.resetConstraints();