From b45f9996d022f0a4702a32dbf071c7428774c1e5 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 23 Feb 2013 00:03:50 +0400 Subject: [PATCH] doing magic testing... Signed-off-by: Alex A. Naanou --- ext-lib/iscroll-custom.js | 2 ++ index2.html | 7 ++++--- layout.js | 9 +++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ext-lib/iscroll-custom.js b/ext-lib/iscroll-custom.js index 09a6fa8..7180a34 100755 --- a/ext-lib/iscroll-custom.js +++ b/ext-lib/iscroll-custom.js @@ -404,6 +404,7 @@ iScroll.prototype = { if (that.options.onBeforeScrollEnd) that.options.onBeforeScrollEnd.call(that, e); + /* // XXX do we need this? if (that.zoomed) { scale = that.scale * that.lastScale; @@ -424,6 +425,7 @@ iScroll.prototype = { if (that.options.onZoomEnd) that.options.onZoomEnd.call(that, e); return; } + */ if (!that.moved) { if (hasTouch) { diff --git a/index2.html b/index2.html index ffe86aa..9252b8d 100755 --- a/index2.html +++ b/index2.html @@ -133,9 +133,10 @@ $(document).ready(function(){ $('.viewer') .on('scrollCancelled', function(){ setCurrentPage() }) //.on('shortClick', handleClick) - .on('swipeLeft', handleSwipeLeft) - .on('swipeRight', handleSwipeRight) - .on('screenReleased', handleScrollRelease) + //.on('swipeLeft', handleSwipeLeft) + //.on('swipeRight', handleSwipeRight) + //.on('screenReleased', handleScrollRelease) + .on('screenReleased swipeRight swipeLeft', handleScrollRelease) /* // try a way of cheating... diff --git a/layout.js b/layout.js index 3478a88..3d3c4f2 100755 --- a/layout.js +++ b/layout.js @@ -77,6 +77,13 @@ function makeSwipeHandler(action){ return function(evt, data){ // ribbon mode... if(isNavigationViewRelative()){ + + // this makes things snap... + if(SNAP_TO_PAGES_IN_RIBBON){ + setCurrentPage() + return + } + return handleScrollRelease(evt, data) } // full page view... @@ -95,11 +102,13 @@ var handleSwipeRight = makeSwipeHandler(nextPage) // explicitly bind them... // XXX restore all the changed values... function handleScrollRelease(evt, data){ + /* // this makes things snap... if(SNAP_TO_PAGES_IN_RIBBON || !isNavigationViewRelative()){ setCurrentPage() return } + */ var speed = data.speed.x var pages = $('.page')