Skip to content
Browse files

Small refactoring

  • Loading branch information...
1 parent f3ed8a4 commit 806400fe6e83ad5626b8dd2138eb0a2dbbf9c317 @mjackson committed
Showing with 2 additions and 5 deletions.
  1. +2 −5 jdrag.js
View
7 jdrag.js
@@ -206,22 +206,19 @@ var jDrag = {};
* Returns `true` if this target's area contains the given point.
*/
Target.prototype.containsPoint = function (point) {
- var x = point.x;
- var y = point.y;
-
var offset = this.jQuery.offset();
var left = offset.left;
var right = left + this.jQuery.width();
- if (x < left || x > right) {
+ if (point.x < left || point.x > right) {
return false;
}
var top = offset.top;
var bottom = top + this.jQuery.height();
- return top < y && bottom > y;
+ return top < point.y && bottom > point.y;
};
var supportsTouch = "createTouch" in document;

0 comments on commit 806400f

Please sign in to comment.
Something went wrong with that request. Please try again.