minor fix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-01-27 00:04:29 +04:00
parent e868732351
commit f7322ee74a

View File

@ -24,6 +24,11 @@ var DRAG_FULL_PAGE = false
togglePageDragging = createCSSClassToggler('.viewer', 'dragging') togglePageDragging = createCSSClassToggler('.viewer', 'dragging')
// this is here only for speed, helps with dragging...
// DO NOT USE DIRECTLY!
var _PAGE_VIEW
// toggle between the two main modes: // toggle between the two main modes:
// - single page mode (.page-view-mode) // - single page mode (.page-view-mode)
// - thumbnail/ribbon mode // - thumbnail/ribbon mode
@ -35,8 +40,10 @@ togglePageView = createCSSClassToggler(
function(action){ function(action){
if(action == 'on'){ if(action == 'on'){
fitNPages(1, !FIT_PAGE_TO_VIEW) fitNPages(1, !FIT_PAGE_TO_VIEW)
_PAGE_VIEW = true
} else { } else {
fitNPages(PAGES_IN_RIBBON) fitNPages(PAGES_IN_RIBBON)
_PAGE_VIEW = false
} }
}) })
@ -66,6 +73,8 @@ function getPageNumber(page){
/************************************************** event handlers ***/ /************************************************** event handlers ***/
// hash url handler...
// NOTE: most of the handling actually happens in loadURLState...
function hashChangeHandler(e){ function hashChangeHandler(e){
e.preventDefault() e.preventDefault()
var r = loadURLState() var r = loadURLState()
@ -93,14 +102,14 @@ function swipeHandler(evt, phase, direction, distance, duration, fingers){
if(phase=='move' if(phase=='move'
// see if wee need to drag the page and allways drag the ribbon... // see if wee need to drag the page and allways drag the ribbon...
&& (DRAG_FULL_PAGE || togglePageView('?') == 'off') && (DRAG_FULL_PAGE || !_PAGE_VIEW)
&& (direction=='left' || direction=='right')){ && (direction=='left' || direction=='right')){
// using the "unanimated" trick we will make the drag real-time... // using the "unanimated" trick we will make the drag real-time...
mag.addClass('unanimated') mag.addClass('unanimated')
if(direction == 'left'){ if(direction == 'left'){
$('.magazine').css({left: -n*cur.width()-distance/scale}) mag.css({left: -n*cur.width()-distance/scale})
} else if(direction == 'right') { } else if(direction == 'right') {
$('.magazine').css({left: -n*cur.width()+distance/scale}) mag.css({left: -n*cur.width()+distance/scale})
} }
setTimeout(function(){mag.removeClass('unanimated')}, 5) setTimeout(function(){mag.removeClass('unanimated')}, 5)