mirror of
https://github.com/flynx/PortableMag.git
synced 2025-12-27 05:42:13 +00:00
added two finger actions and migrated article nav...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
c09e069dca
commit
0bbb0aeb6b
@ -85,6 +85,11 @@ function prepareTransitions(elem){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
$(window)
|
||||||
|
//.resize(viewResizeHandler)
|
||||||
|
.resize(updateView)
|
||||||
|
.bind('hashchange', hashChangeHandler)
|
||||||
|
|
||||||
// keyboard...
|
// keyboard...
|
||||||
$(document)
|
$(document)
|
||||||
.keydown(makeKeyboardHandler({
|
.keydown(makeKeyboardHandler({
|
||||||
|
|||||||
15
layout.js
15
layout.js
@ -94,7 +94,7 @@ function handleLongClick(evt, data){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeSwipeHandler(action){
|
function makeSwipeHandler(actionA, actionB){
|
||||||
return function(evt, data){
|
return function(evt, data){
|
||||||
// ribbon mode...
|
// ribbon mode...
|
||||||
if(isNavigationViewRelative()){
|
if(isNavigationViewRelative()){
|
||||||
@ -112,11 +112,15 @@ function makeSwipeHandler(action){
|
|||||||
//setTransitionEasing(mag, 'ease-out')
|
//setTransitionEasing(mag, 'ease-out')
|
||||||
setTransitionEasing(mag, 'cubic-bezier(0.33,0.66,0.66,1)')
|
setTransitionEasing(mag, 'cubic-bezier(0.33,0.66,0.66,1)')
|
||||||
|
|
||||||
action($('.current.page'))
|
if(data.fingers == 2){
|
||||||
|
actionA($('.current.page'))
|
||||||
|
} else {
|
||||||
|
actionA($('.current.page'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var handleSwipeLeft = makeSwipeHandler(prevPage)
|
var handleSwipeLeft = makeSwipeHandler(prevPage, prevArticle)
|
||||||
var handleSwipeRight = makeSwipeHandler(nextPage)
|
var handleSwipeRight = makeSwipeHandler(nextPage, nextArticle)
|
||||||
|
|
||||||
// do snap and innertia...
|
// do snap and innertia...
|
||||||
// NOTE: this will also handle swipeUp/swopeDown as we do not
|
// NOTE: this will also handle swipeUp/swopeDown as we do not
|
||||||
@ -312,6 +316,9 @@ function setCurrentPage(n){
|
|||||||
if(n == null){
|
if(n == null){
|
||||||
n = getPageNumber()
|
n = getPageNumber()
|
||||||
}
|
}
|
||||||
|
if(typeof(n) != typeof(3)){
|
||||||
|
n = getPageNumber(n)
|
||||||
|
}
|
||||||
var l = $('.page').length
|
var l = $('.page').length
|
||||||
// normalize the number...
|
// normalize the number...
|
||||||
n = n < 0 ? l - n : n
|
n = n < 0 ? l - n : n
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user