mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
TOC: highlight first chapter on page instead of last
So its in sync with the chapter shown in the footer,
which was previously fixed with a482baac.
This commit is contained in:
@@ -564,8 +564,14 @@ end
|
||||
function ReaderToc:updateCurrentNode()
|
||||
if #self.collapsed_toc > 0 and self.pageno then
|
||||
for i, v in ipairs(self.collapsed_toc) do
|
||||
if v.page > self.pageno then
|
||||
self.collapsed_toc.current = i > 1 and i - 1 or 1
|
||||
if v.page >= self.pageno then
|
||||
if v.page == self.pageno then
|
||||
-- Use first TOC item on current page (which may have others)
|
||||
self.collapsed_toc.current = i
|
||||
else
|
||||
-- Use previous TOC item (if any), which is on a previous page
|
||||
self.collapsed_toc.current = i > 1 and i - 1 or 1
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user