diff --git a/TODO.otl b/TODO.otl index 08b7041..3397aa0 100755 --- a/TODO.otl +++ b/TODO.otl @@ -1,5 +1,5 @@ -[_] 27% Priority work - [_] 45% general todo +[_] 29% Priority work + [_] 50% general todo [_] populate an example issue [_] test for stability [_] cleanup code @@ -11,6 +11,7 @@ [_] BUG: href to existing anchors will mess up layout... | need to find out how can we disable anchor links from actually | going to the anchor... + [X] added pinch events... [X] #URL "layers" | navigation to a hidden layer will show the layer, any other | navigation will hide it... diff --git a/magazine.js b/magazine.js index 57c5ecc..207c283 100755 --- a/magazine.js +++ b/magazine.js @@ -314,7 +314,7 @@ function fitPagesToContent(n){ } -function swipeUpdate(evt, phase, direction, distance){ +function swipeUpdate(evt, phase, direction, distance, duration, fingers){ var pages = $('.page') var cur = $('.current.page') var n = pages.index(cur) @@ -345,10 +345,20 @@ function swipeUpdate(evt, phase, direction, distance){ // prev page... if(direction == 'right') { - setCurrentPage(Math.max(n-p, 0)) + // two+ fingers moves to closest article... + if(fingers >= 2){ + prevArticle() + } else { + setCurrentPage(Math.max(n-p, 0)) + } // next page... } else if (direction == 'left'){ - setCurrentPage(Math.min(n+p, pages.length-1)) + // two+ fingers moves to closest article... + if(fingers >= 2){ + nextArticle() + } else { + setCurrentPage(Math.min(n+p, pages.length-1)) + } } } }