credocument reader optimisation (avoid multiple TOC builds) (#3292)

Avoid unnecessary work in ReaderView:onSetViewMode() and
ReaderRolling:updatePos() that would result in TOC being reset
and rebuilt (which can take time on books with huge TOC) during
reader setup.
This commit is contained in:
poire-z
2017-10-03 00:31:14 +02:00
committed by GitHub
parent e5675af467
commit 26def92983
3 changed files with 10 additions and 6 deletions

View File

@@ -94,6 +94,8 @@ function ReaderRolling:init()
table.insert(self.ui.postInitCallback, function()
self.doc_height = self.ui.document.info.doc_height
self.old_doc_height = self.doc_height
self.ui.document:_readMetadata()
self.old_page = self.ui.document.info.number_of_pages
end)
self.ui.menu:registerToMainMenu(self)
end