mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-31 20:10:13 +00:00
more digging...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
581dc652d8
commit
865261125f
2
TODO.otl
2
TODO.otl
@ -7,7 +7,7 @@
|
|||||||
| stalled...
|
| stalled...
|
||||||
[_] 64% general todo
|
[_] 64% general todo
|
||||||
[_] 0% STUB: build a UI around current iscroll to allow time for internal scroll devel
|
[_] 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
|
[_] scale .content ot fit in page
|
||||||
| this will temporarily disable these features:
|
| this will temporarily disable these features:
|
||||||
groups (depends on style)
|
groups (depends on style)
|
||||||
|
|||||||
@ -147,12 +147,14 @@ var m = Math,
|
|||||||
that.options.zoom = that.options.useTransform && that.options.zoom;
|
that.options.zoom = that.options.useTransform && that.options.zoom;
|
||||||
that.options.useTransition = hasTransitionEnd && that.options.useTransition;
|
that.options.useTransition = hasTransitionEnd && that.options.useTransition;
|
||||||
|
|
||||||
|
/* XXX removed for now...
|
||||||
// Helpers FIX ANDROID BUG!
|
// Helpers FIX ANDROID BUG!
|
||||||
// translate3d and scale doesn't work together!
|
// translate3d and scale doesn't work together!
|
||||||
// Ignoring 3d ONLY WHEN YOU SET that.options.zoom
|
// Ignoring 3d ONLY WHEN YOU SET that.options.zoom
|
||||||
if ( that.options.zoom && isAndroid ){
|
if ( that.options.zoom && isAndroid ){
|
||||||
translateZ = '';
|
translateZ = '';
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// Set some default styles
|
// Set some default styles
|
||||||
that.scroller.style[transitionProperty] = that.options.useTransform ? cssVendor + 'transform' : 'top left';
|
that.scroller.style[transitionProperty] = that.options.useTransform ? cssVendor + 'transform' : 'top left';
|
||||||
@ -349,7 +351,7 @@ iScroll.prototype = {
|
|||||||
that.absDistX = m.abs(that.distX);
|
that.absDistX = m.abs(that.distX);
|
||||||
that.absDistY = m.abs(that.distY);
|
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) {
|
if (that.absDistX < 6 && that.absDistY < 6) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -402,6 +404,7 @@ iScroll.prototype = {
|
|||||||
|
|
||||||
if (that.options.onBeforeScrollEnd) that.options.onBeforeScrollEnd.call(that, e);
|
if (that.options.onBeforeScrollEnd) that.options.onBeforeScrollEnd.call(that, e);
|
||||||
|
|
||||||
|
// XXX do we need this?
|
||||||
if (that.zoomed) {
|
if (that.zoomed) {
|
||||||
scale = that.scale * that.lastScale;
|
scale = that.scale * that.lastScale;
|
||||||
//scale = Math.max(that.options.zoomMin, scale);
|
//scale = Math.max(that.options.zoomMin, scale);
|
||||||
@ -787,7 +790,7 @@ iScroll.prototype = {
|
|||||||
pos = 0,
|
pos = 0,
|
||||||
page = 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.wrapperW = that.wrapper.clientWidth || 1;
|
||||||
that.wrapperH = that.wrapper.clientHeight || 1;
|
that.wrapperH = that.wrapper.clientHeight || 1;
|
||||||
|
|
||||||
|
|||||||
@ -107,24 +107,30 @@ $(document).ready(function(){
|
|||||||
logger = Logger()
|
logger = Logger()
|
||||||
var scrolling = false
|
var scrolling = false
|
||||||
var _x = null
|
var _x = null
|
||||||
|
var _t = null
|
||||||
$('.viewer')
|
$('.viewer')
|
||||||
|
|
||||||
.on('mousedown touchstart', function(){
|
.on('mousedown touchstart', function(){
|
||||||
logger.log('[touchstart]')
|
logger.log('[touchstart]')
|
||||||
|
//_t = evt.timeStamp || Date.now();
|
||||||
scrolling = true
|
scrolling = true
|
||||||
togglePageDragging('on')
|
togglePageDragging('on')
|
||||||
})
|
})
|
||||||
|
|
||||||
.on('mousemove touchmove', function(evt){
|
.on('mousemove touchmove', function(evt){
|
||||||
|
//var t = evt.timeStamp || Date.now();
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
if(_x == null){
|
if(_x == null){
|
||||||
_x = evt.clientX
|
_x = evt.clientX
|
||||||
}
|
}
|
||||||
var x = evt.clientX
|
var x = evt.clientX
|
||||||
if(scrolling){
|
if(scrolling && Math.abs(x-_x) > 6){
|
||||||
logger.log('[drag]')
|
//logger.log('[drag]')
|
||||||
shiftMagazineTo(getMagazineShift() + (x - _x))
|
shiftMagazineTo(getMagazineShift() + (x - _x))
|
||||||
}
|
}
|
||||||
_x = x
|
_x = x
|
||||||
})
|
})
|
||||||
|
|
||||||
.on('mouseup touchend', function(){
|
.on('mouseup touchend', function(){
|
||||||
logger.log('[touchend]')
|
logger.log('[touchend]')
|
||||||
scrolling = false
|
scrolling = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user