diff --git a/index.html b/index.html index 448753f..108b73f 100755 --- a/index.html +++ b/index.html @@ -85,6 +85,11 @@ function prepareTransitions(elem){ } $(document).ready(function(){ + $(window) + //.resize(viewResizeHandler) + .resize(updateView) + .bind('hashchange', hashChangeHandler) + // keyboard... $(document) .keydown(makeKeyboardHandler({ diff --git a/layout.js b/layout.js index e4f121a..5cab4c2 100755 --- a/layout.js +++ b/layout.js @@ -94,7 +94,7 @@ function handleLongClick(evt, data){ } } -function makeSwipeHandler(action){ +function makeSwipeHandler(actionA, actionB){ return function(evt, data){ // ribbon mode... if(isNavigationViewRelative()){ @@ -112,11 +112,15 @@ function makeSwipeHandler(action){ //setTransitionEasing(mag, 'ease-out') 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 handleSwipeRight = makeSwipeHandler(nextPage) +var handleSwipeLeft = makeSwipeHandler(prevPage, prevArticle) +var handleSwipeRight = makeSwipeHandler(nextPage, nextArticle) // do snap and innertia... // NOTE: this will also handle swipeUp/swopeDown as we do not @@ -312,6 +316,9 @@ function setCurrentPage(n){ if(n == null){ n = getPageNumber() } + if(typeof(n) != typeof(3)){ + n = getPageNumber(n) + } var l = $('.page').length // normalize the number... n = n < 0 ? l - n : n