mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
goto current toc entry automatically when open TOC window
This commit is contained in:
@@ -303,8 +303,6 @@ function ReaderToc:onShowToc()
|
||||
end
|
||||
end
|
||||
|
||||
self:updateCurrentNode()
|
||||
|
||||
local button_size = self.expand_button:getSize()
|
||||
local toc_menu = Menu:new{
|
||||
title = _("Table of Contents"),
|
||||
@@ -353,8 +351,11 @@ function ReaderToc:onShowToc()
|
||||
|
||||
self.toc_menu = toc_menu
|
||||
|
||||
self:updateCurrentNode()
|
||||
-- auto expand the parent node of current page
|
||||
self:expandParentNode(self:getTocIndexByPage(self.pageno))
|
||||
-- auto goto page of the current toc entry
|
||||
self.toc_menu:swithItemTable(nil, self.collapsed_toc, self.collapsed_toc.current or -1)
|
||||
|
||||
UIManager:show(menu_container)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user