mirror of
https://github.com/flynx/PortableMag.git
synced 2025-12-23 12:01:48 +00:00
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:
parent
0abaece2ca
commit
76499b6c8f
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user