made the layout.html's getPageNumber compatible with the main implementation in magazine.js...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-02-11 17:46:56 +04:00
parent 0abaece2ca
commit 76499b6c8f

View File

@ -45,7 +45,10 @@
<script>
function getPageNumber(){
function getPageNumber(page){
if(page != null){
return $('.page').index($(page))
} else {
var s = $('.viewer').scrollLeft()
var W = $('.viewer').width()
var cur = -1
@ -58,6 +61,7 @@ function getPageNumber(){
cur = res.index(Math.min.apply(Math, res))
return cur
}
}
function setCurrentPage(n){
if(n == null){
n = getPageNumber()