We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
description: The Drag.Move.Collide class makes it easy to detect when two or more elements collide when dragging another element.
authors:
license:
requires:
provides:
Drag.Move.Collide = new Class({
Extends: Drag.Move, options: {/* onCollide: function(thisElement, thisOvered){}, onLeaveCollision: function(thisElement, overed){},*/ checkDroppables: false, checkCollision: true }, initialize: function(element, options){ this.parent(element, options); if (this.options.checkCollision) this.addEvent('start', this.checkCollision, true); this.overed = null; }, checkDroppables: function() { if(this.options.checkDroppables) this.parent(); }, checkCollision: function(){ var overed = this.droppables.filter(function(el, i){ return el.collide(this.element); }, this); if (this.overed != overed){ if (this.overed) this.fireEvent('leaveCollision', [this.element, this.overed]); if (overed) this.fireEvent('collide', [this.element, overed]); this.overed = overed; } }, drag: function(event){ this.parent(event); if (this.options.checkCollision && this.droppables.length) this.checkCollision(); }, stop: function(event){ if (this.options.checkCollision && this.droppables.length) this.checkCollision(); this.fireEvent('drop', [this.element, this.overed, event]); this.overed = null; var events = { mousemove: this.bound.drag, mouseup: this.bound.stop }; events[this.selection] = this.bound.eventStop; this.document.removeEvents(events); if (event) this.fireEvent('complete', [this.element, event]); } });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
/*
description: The Drag.Move.Collide class makes it easy to detect when two or more elements collide when dragging another element.
authors:
license:
requires:
provides:
...
*/
Drag.Move.Collide = new Class({
The text was updated successfully, but these errors were encountered: