From 865261125fe5db8590b8762aa07e6e6cb4ec50dc Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 18 Feb 2013 18:27:17 +0400 Subject: [PATCH] more digging... Signed-off-by: Alex A. Naanou --- TODO.otl | 2 +- ext-lib/iscroll-custom.js | 7 +++++-- layout-iscroll2.html | 10 ++++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/TODO.otl b/TODO.otl index 7c4c9ba..aaa2d06 100755 --- a/TODO.otl +++ b/TODO.otl @@ -7,7 +7,7 @@ | stalled... [_] 64% general todo [_] 0% STUB: build a UI around current iscroll to allow time for internal scroll devel - [_] resize pages to screen on load + [_] manually resize pages to screen on load [_] scale .content ot fit in page | this will temporarily disable these features: groups (depends on style) diff --git a/ext-lib/iscroll-custom.js b/ext-lib/iscroll-custom.js index 19b11fa..09a6fa8 100755 --- a/ext-lib/iscroll-custom.js +++ b/ext-lib/iscroll-custom.js @@ -147,12 +147,14 @@ var m = Math, that.options.zoom = that.options.useTransform && that.options.zoom; that.options.useTransition = hasTransitionEnd && that.options.useTransition; + /* XXX removed for now... // Helpers FIX ANDROID BUG! // translate3d and scale doesn't work together! // Ignoring 3d ONLY WHEN YOU SET that.options.zoom if ( that.options.zoom && isAndroid ){ translateZ = ''; } + */ // Set some default styles that.scroller.style[transitionProperty] = that.options.useTransform ? cssVendor + 'transform' : 'top left'; @@ -349,7 +351,7 @@ iScroll.prototype = { that.absDistX = m.abs(that.distX); that.absDistY = m.abs(that.distY); - // XXX why is this here?? + // XXX this appears to be a move threshold... if (that.absDistX < 6 && that.absDistY < 6) { return; } @@ -402,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; //scale = Math.max(that.options.zoomMin, scale); @@ -787,7 +790,7 @@ iScroll.prototype = { pos = 0, page = 0; - if (that.scale < that.options.zoomMin) that.scale = that.options.zoomMin; + //if (that.scale < that.options.zoomMin) that.scale = that.options.zoomMin; that.wrapperW = that.wrapper.clientWidth || 1; that.wrapperH = that.wrapper.clientHeight || 1; diff --git a/layout-iscroll2.html b/layout-iscroll2.html index da5ce5d..28b3192 100755 --- a/layout-iscroll2.html +++ b/layout-iscroll2.html @@ -107,24 +107,30 @@ $(document).ready(function(){ logger = Logger() var scrolling = false var _x = null + var _t = null $('.viewer') + .on('mousedown touchstart', function(){ logger.log('[touchstart]') + //_t = evt.timeStamp || Date.now(); scrolling = true togglePageDragging('on') }) + .on('mousemove touchmove', function(evt){ + //var t = evt.timeStamp || Date.now(); evt.preventDefault() if(_x == null){ _x = evt.clientX } var x = evt.clientX - if(scrolling){ - logger.log('[drag]') + if(scrolling && Math.abs(x-_x) > 6){ + //logger.log('[drag]') shiftMagazineTo(getMagazineShift() + (x - _x)) } _x = x }) + .on('mouseup touchend', function(){ logger.log('[touchend]') scrolling = false