From: Alan Knowles Date: Thu, 10 Feb 2011 09:53:37 +0000 (+0800) Subject: docs/symbols/src/Roo_dd_DropTarget.js.html X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=f3d778dcf629f1c33c8600b2e8dfff0b8e73c889 docs/symbols/src/Roo_dd_DropTarget.js.html --- diff --git a/docs/symbols/src/Roo_dd_DropTarget.js.html b/docs/symbols/src/Roo_dd_DropTarget.js.html index d3996e936b..c00e47c803 100644 --- a/docs/symbols/src/Roo_dd_DropTarget.js.html +++ b/docs/symbols/src/Roo_dd_DropTarget.js.html @@ -22,78 +22,84 @@ Roo.dd.DropTarget = function(el, config){ this.el = Roo.get(el); + var listeners = false; ; + if (config && config.listeners) { + listeners= config.listeners; + delete config.listeners; + } Roo.apply(this, config); if(this.containerScroll){ Roo.dd.ScrollManager.register(this.el); } - + this.addEvents( { + /** + * @scope Roo.dd.DropTarget + */ + + /** + * @event enter + * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the source is now over the + * target. This default implementation adds the CSS class specified by overClass (if any) to the drop element + * and returns the dropAllowed config value. This method should be overridden if drop validation is required. + * + * IMPORTANT : it should set this.overClass and this.dropAllowed + * + * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target + * @param {Event} e The event + * @param {Object} data An object containing arbitrary data supplied by the drag source + */ + "enter" : true, + + /** + * @event over + * The function a {@link Roo.dd.DragSource} calls continuously while it is being dragged over the target. + * This method will be called on every mouse movement while the drag source is over the drop target. + * This default implementation simply returns the dropAllowed config value. + * + * IMPORTANT : it should set this.dropAllowed + * + * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target + * @param {Event} e The event + * @param {Object} data An object containing arbitrary data supplied by the drag source + + */ + "over" : true, + /** + * @event out + * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the source has been dragged + * out of the target without dropping. This default implementation simply removes the CSS class specified by + * overClass (if any) from the drop element. + * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target + * @param {Event} e The event + * @param {Object} data An object containing arbitrary data supplied by the drag source + */ + "out" : true, + + /** + * @event drop + * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the dragged item has + * been dropped on it. This method has no default implementation and returns false, so you must provide an + * implementation that does something to process the drop event and returns true so that the drag source's + * repair action does not run. + * + * IMPORTANT : it should set this.success + * + * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target + * @param {Event} e The event + * @param {Object} data An object containing arbitrary data supplied by the drag source + */ + "drop" : true + }); + Roo.dd.DropTarget.superclass.constructor.call( this, this.el.dom, this.ddGroup || this.group, { isTarget: true, - events : { - /** - * @scope Roo.dd.DropTarget - */ - - /** - * @event enter - * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the source is now over the - * target. This default implementation adds the CSS class specified by overClass (if any) to the drop element - * and returns the dropAllowed config value. This method should be overridden if drop validation is required. - * - * IMPORTANT : it should set this.overClass and this.dropAllowed - * - * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - */ - "enter" : true, - - /** - * @event over - * The function a {@link Roo.dd.DragSource} calls continuously while it is being dragged over the target. - * This method will be called on every mouse movement while the drag source is over the drop target. - * This default implementation simply returns the dropAllowed config value. - * - * IMPORTANT : it should set this.dropAllowed - * - * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - - */ - "over" : true, - /** - * @event out - * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the source has been dragged - * out of the target without dropping. This default implementation simply removes the CSS class specified by - * overClass (if any) from the drop element. - * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - */ - "out" : true, - - /** - * @event drop - * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the dragged item has - * been dropped on it. This method has no default implementation and returns false, so you must provide an - * implementation that does something to process the drop event and returns true so that the drag source's - * repair action does not run. - * - * IMPORTANT : it should set this.success - * - * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target - * @param {Event} e The event - * @param {Object} data An object containing arbitrary data supplied by the drag source - */ - "drop" : true - } - + listeners : listeners || {} + } ); @@ -126,7 +132,7 @@ */ success : false, /** - * @cfg {boolean} valid + * @cfg {boolean|String} valid true/false or string (ok-add/ok-sub/ok/nodrop) * if the drop point is valid for over/enter.. */ valid : false, @@ -139,29 +145,36 @@ /** * @hide */ - notifyEnter : function(dd, e, data){ + notifyEnter : function(dd, e, data) + { this.valid = true; - this.fireEvent('enter', this, dd, e, data); + this.fireEvent('enter', dd, e, data); if(this.overClass){ this.el.addClass(this.overClass); } - return this.valid ? this.dropAllowed : this.dropNotAllowed; + return typeof(this.valid) == 'string' ? 'x-dd-drop-' + this.valid : ( + this.valid ? this.dropAllowed : this.dropNotAllowed + ); }, /** * @hide */ - notifyOver : function(dd, e, data){ + notifyOver : function(dd, e, data) + { this.valid = true; - this.fireEvent('over', this, dd, e, data); - return this.valid ? this.dropAllowed : this.dropNotAllowed; + this.fireEvent('over', dd, e, data); + return typeof(this.valid) == 'string' ? 'x-dd-drop-' + this.valid : ( + this.valid ? this.dropAllowed : this.dropNotAllowed + ); }, /** * @hide */ - notifyOut : function(dd, e, data){ - this.fireEvent('out', this, dd, e, data); + notifyOut : function(dd, e, data) + { + this.fireEvent('out', dd, e, data); if(this.overClass){ this.el.removeClass(this.overClass); } @@ -170,9 +183,10 @@ /** * @hide */ - notifyDrop : function(dd, e, data){ + notifyDrop : function(dd, e, data) + { this.success = false; - this.fireEvent('drop', this, dd, e, data); + this.fireEvent('drop', dd, e, data); return this.success; } }); \ No newline at end of file