goto current toc entry automatically when open TOC window

pull/1413/head
chrox 9 years ago
parent 5b76805911
commit 3a0960d391

@ -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)

Loading…
Cancel
Save