Footer current chapter: use first chapter on page instead of last
This commit is contained in:
1 parent
564db73cd8
commit
a482baac5b
1 file changed
+6
@@ -243,7 +243,13 @@ function ReaderToc:getTocIndexByPage(pn_or_xp)
|
||||
end
|
||||
local pre_index = 1
|
||||
for _k,_v in ipairs(self.toc) do
|
||||
if _v.page == pageno then
|
||||
-- Return the first chapter seen on the current page
|
||||
pre_index = _k
|
||||
break
|
||||
end
|
||||
if _v.page > pageno then
|
||||
-- Return last chapter seen on a previous page
|
||||
break
|
||||
end
|
||||
pre_index = _k
|
||||
|
||||
Reference in new issue
Block a user