Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change the version of the Element.Collide to 0.5

  • Loading branch information...
commit fd6c220ff1cc13e5f07f8947ea51d9ba4cf01085 1 parent 8a29bca
@jnbdz authored
Showing with 8 additions and 10 deletions.
  1. +7 −9 Demos/assets/js/Element.collide.js
  2. +1 −1  Source/Drag.Move.Collide.js
View
16 Demos/assets/js/Element.collide.js
@@ -17,15 +17,13 @@ provides:
*/
Element.implement({
- collide: function(el2){
- this.offsetBottom = this.offsetTop + this.offsetHeight;
- this.offsetRight = this.offsetLeft + this.offsetWidth;
- el2.offsetBottom = el2.offsetTop + el2.offsetHeight;
- el2.offsetRight = el2.offsetLeft + el2.offsetWidth;
+ collide: function(el){
+ var thisCoors = this.getCoordinates(),
+ elCoors = el.getCoordinates();
- return !((this.offsetBottom < el2.offsetTop) ||
- (this.offsetTop > el2.offsetBottom) ||
- (this.offsetRight < el2.offsetLeft) ||
- (this.offsetLeft > el2.offsetRight));
+ return !((thisCoors['bottom'] < elCoors['top']) ||
+ (thisCoors['top'] > elCoors['bottom']) ||
+ (thisCoors['right'] < elCoors['left']) ||
+ (thisCoors['left'] > elCoors['right']));
}
});
View
2  Source/Drag.Move.Collide.js
@@ -12,7 +12,7 @@ requires:
- core/1.4: '*'
- more:1.4.0.1/Drag
- more:1.4.0.1/Drag.Move
- - Element.collide/0.4
+ - Element.collide/0.5
provides:
- Drag.Move.Collide
Please sign in to comment.
Something went wrong with that request. Please try again.