From 48e31846c6992a1d17138f6f2098416d92bd646e Mon Sep 17 00:00:00 2001 From: Richard Saunders Date: Fri, 3 Oct 2014 15:34:31 +0100 Subject: [PATCH 1/2] Added settings.draggingTimeout. Useful so that the onClick events know they were dragged. without it the dragging flag is set back to false before the click event fires. --- README.md | 1 + dist/jquery.overscroll.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f40ba69..eee674e 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ jQuery.fn.overscroll.settings = { thumbOpacity: 0.7, // The default active opacity for the thumbs thumbThickness: 6, // The thickness, in pixels, of the generated thumbs thumbTimeout: 400, // The amount of time to wait before fading out thumbs + draggingTimeout: 100, // The amount of time to wait before resetting the dragging flag back to false after stop dragging (useful when detecting dragging in onClick events } ``` diff --git a/dist/jquery.overscroll.js b/dist/jquery.overscroll.js index 8bc9662..3c30343 100644 --- a/dist/jquery.overscroll.js +++ b/dist/jquery.overscroll.js @@ -48,6 +48,7 @@ thumbOpacity: 0.7, thumbThickness: 6, thumbTimeout: 400, + draggingTimeout: 100, wheelDelta: 20, wheelTicks: 120 }; @@ -519,12 +520,13 @@ } // clear all internal flags and settings - target.data(datakey).dragging = + setTimeout(function() { target.data(datakey).dragging = data.start = data.capture = data.position = flags.dragged = flags.dragging = false; + }, settings.draggingTimeout); // set the cursor back to normal target.css('cursor', compat().cursor.grab); From e98a6b5c6d8e8582ca844e1de5b38caf6504e240 Mon Sep 17 00:00:00 2001 From: Richard Saunders Date: Mon, 6 Oct 2014 16:40:01 +0100 Subject: [PATCH 2/2] trivial - fixed incorrect indentation and missing closing bracket in comment --- README.md | 2 +- dist/jquery.overscroll.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eee674e..1ebd739 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ jQuery.fn.overscroll.settings = { thumbOpacity: 0.7, // The default active opacity for the thumbs thumbThickness: 6, // The thickness, in pixels, of the generated thumbs thumbTimeout: 400, // The amount of time to wait before fading out thumbs - draggingTimeout: 100, // The amount of time to wait before resetting the dragging flag back to false after stop dragging (useful when detecting dragging in onClick events + draggingTimeout: 100, // The amount of time to wait before resetting the dragging flag back to false after stop dragging (useful when detecting dragging in onClick events) } ``` diff --git a/dist/jquery.overscroll.js b/dist/jquery.overscroll.js index 3c30343..c27b2b1 100644 --- a/dist/jquery.overscroll.js +++ b/dist/jquery.overscroll.js @@ -48,7 +48,7 @@ thumbOpacity: 0.7, thumbThickness: 6, thumbTimeout: 400, - draggingTimeout: 100, + draggingTimeout: 100, wheelDelta: 20, wheelTicks: 120 };