added multy-finger swipes...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-01-23 17:36:01 +04:00
parent 78566ae516
commit f6a9da12a4
2 changed files with 16 additions and 5 deletions

View File

@ -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...

View File

@ -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))
}
}
}
}