diff --git a/layout.html b/layout.html
index 42d3442..1233301 100755
--- a/layout.html
+++ b/layout.html
@@ -86,11 +86,14 @@ $(document).ready(function(){
},
function(k){console.log(k)}))
- /*
+ $('.viewer')
+ .on('mouseup touchend', function(evt){
+ setCurrentPage()
+ })
+
if(!NAVIGATE_RELATIVE_TO_VISIBLE){
$('.viewer').css({overflow: 'hidden'})
}
- */
// expand the templates...
runMagazineTemplates()
diff --git a/layout.js b/layout.js
index fdcb0b3..f76bee1 100755
--- a/layout.js
+++ b/layout.js
@@ -4,7 +4,8 @@
*
**********************************************************************/
-var NAVIGATE_RELATIVE_TO_VISIBLE = false
+//var NAVIGATE_RELATIVE_TO_VISIBLE = false
+var NAVIGATE_RELATIVE_TO_VISIBLE = true
var USE_PAGE_ALIGN = true
@@ -78,11 +79,16 @@ var togglePageView = createCSSClassToggler(
/********************************************************* helpers ***/
function getPageNumber(page){
+ // a page is given...
if(page != null){
return $('.page').index($(page))
}
+
+ // get the next page...
if(!NAVIGATE_RELATIVE_TO_VISIBLE){
return $('.page').index($('.current.page'))
+
+ // get the closest page to view...
} else {
// XXX this gets crazy when magazine is scaled...
var s = $('.viewer').scrollLeft()