Skip to content

Commit

Permalink
goto current toc entry automatically when open TOC window
Browse files Browse the repository at this point in the history
  • Loading branch information
chrox committed Feb 3, 2015
1 parent 5b76805 commit 3a0960d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/apps/reader/modules/readertoc.lua
Expand Up @@ -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"),
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3a0960d

Please sign in to comment.