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