From c3f949a4045b6ac0d953447afd9ce2fa4b62f74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?La=CC=81szlo=CC=81=20Ka=CC=81rolyi?= Date: Tue, 22 Apr 2014 20:49:47 +0200 Subject: [PATCH] Closes #5, using $.offset instead of clientHeight --- selectableScroll.js | 8 ++++---- ui-selectableScroll.jquery.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/selectableScroll.js b/selectableScroll.js index 3e75a49..6c8724f 100644 --- a/selectableScroll.js +++ b/selectableScroll.js @@ -94,11 +94,11 @@ * @return boolean The parent's _mouseStart return value */ _mouseStart: function (event) { + var pos = this.scrollElement.offset(); if ( - (event.pageX > this.scrollElement.prop('clientWidth') + - this.scrollElement.prop('offsetLeft')) || - (event.pageY > this.scrollElement.prop('clientHeight') + - this.scrollElement.prop('offsetTop'))) { + (event.pageX > this.scrollElement.prop('clientWidth') + pos.left) || + (event.pageY > this.scrollElement.prop('clientHeight') + pos.top) + ) { return false; } var retValue = $.ui.selectable.prototype._mouseStart.call(this, diff --git a/ui-selectableScroll.jquery.json b/ui-selectableScroll.jquery.json index 9ad60ef..151b169 100644 --- a/ui-selectableScroll.jquery.json +++ b/ui-selectableScroll.jquery.json @@ -1,6 +1,6 @@ { "name": "ui-selectableScroll", - "version": "0.1.5", + "version": "0.1.6", "title": "An extended jQuery-ui selectable with scroll capabilities", "licenses": [{ "type": "GPLv3",