From: Jan Schneider Date: Sat, 10 Jul 2010 09:47:19 +0000 (+0200) Subject: Fix dragging in scrolled view correctly. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=40d2b922ff191bbeba0d03f1d24156cd07ea9917;p=horde.git Fix dragging in scrolled view correctly. --- diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 1a5ac6465..be83ef545 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -1850,7 +1850,7 @@ KronolithCore = { if (draggerTop) { opts.snap = function(x, y) { - y = Math.max(0, step * (Math.min(maxTop, y) / step | 0)) - this.scrollTop; + y = Math.max(0, step * (Math.min(maxTop, y - this.scrollTop) / step | 0)); return [0, y]; }.bind(this); var d = new Drag(event.value.nodeId + 'top', opts); @@ -1864,7 +1864,7 @@ KronolithCore = { if (draggerBottom) { opts.snap = function(x, y) { - y = Math.min(maxBottom + dragBottomHeight + KronolithCore[storage].spacing, step * ((Math.max(minBottom, y) + dragBottomHeight + KronolithCore[storage].spacing) / step | 0)) - dragBottomHeight - KronolithCore[storage].spacing - this.scrollTop; + y = Math.min(maxBottom + dragBottomHeight + KronolithCore[storage].spacing, step * ((Math.max(minBottom, y - this.scrollTop) + dragBottomHeight + KronolithCore[storage].spacing) / step | 0)) - dragBottomHeight - KronolithCore[storage].spacing; return [0, y]; }.bind(this); var d = new Drag(event.value.nodeId + 'bottom', opts); @@ -1890,7 +1890,7 @@ KronolithCore = { x = (view == 'week') ? Math.max(minLeft, stepX * ((Math.min(maxLeft, x - (x < 0 ? stepX : 0)) + stepX / 2) / stepX | 0)) : 0; - y = Math.max(0, step * (Math.min(maxDiv, y) / step | 0)) - this.scrollTop; + y = Math.max(0, step * (Math.min(maxDiv, y - this.scrollTop) / step | 0)); return [x, y]; }.bind(this) });