From 429ba7f1b22be0ba15298e3a9be65764d4be9e73 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 26 Feb 2013 04:37:47 +0400 Subject: [PATCH] added a during scroll callback to scroller... Signed-off-by: Alex A. Naanou --- lib/scroller.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/scroller.js b/lib/scroller.js index 1ad2d11..7feac63 100755 --- a/lib/scroller.js +++ b/lib/scroller.js @@ -178,6 +178,8 @@ function makeScrollHandler(root, config){ prev_t = t options.enableUserScrollEvent && root.trigger('userScroll') + // XXX do we need to pass something to this? + options.scrollCallback && options.scrollCallback() } return false } @@ -274,13 +276,6 @@ function makeScrollHandler(root, config){ // i.e. the callback will get called with the "cancelling" state. scrollCancelThreshold: 100, - // these control weather in-scroll events will get triggered. - // NOTE: these may impact performance, especially the scroll - // event, thus they need to enabled explicitly. - enabelStartEvent: false, - enableUserScrollEvent: false, - enableEndEvent: false, - /* // XXX padding within the target element moving out of which // will cancell the action... @@ -289,8 +284,17 @@ function makeScrollHandler(root, config){ eventBounds: 5, */ + // these control weather in-scroll events will get triggered. + // NOTE: these may impact performance, especially the scroll + // event, thus they need to enabled explicitly. + enabelStartEvent: false, + enableUserScrollEvent: false, + enableEndEvent: false, + // callback to be called when the user first touches the screen... preCallback: null, + // callback to be called when a scroll step is done... + scrollCallback: null, // callback to be called when the user lifts a finger/mouse. // NOTE: this may happen before the scroll is done, for instance // when one of several fingers participating in the action