mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
readerfooter(fix): only populate footer info after document is loaded
This commit is contained in:
@@ -314,7 +314,13 @@ function ReaderFooter:updateFooterPos()
|
||||
self:updateFooterText()
|
||||
end
|
||||
|
||||
-- updateFooterText will start as a noop. After onReaderReady event is
|
||||
-- received, it will initialized as _updateFooterText
|
||||
function ReaderFooter:updateFooterText()
|
||||
end
|
||||
|
||||
-- only call this function after document is fully loaded
|
||||
function ReaderFooter:_updateFooterText()
|
||||
if self.settings.toc_markers and self.progress_bar.ticks == nil then
|
||||
local ticks_candidates = {}
|
||||
if self.ui.toc then
|
||||
@@ -410,6 +416,10 @@ function ReaderFooter:onUpdatePos()
|
||||
self:updateFooter()
|
||||
end
|
||||
|
||||
function ReaderFooter:onReaderReady()
|
||||
self.updateFooterText = self._updateFooterText
|
||||
self:updateFooter()
|
||||
end
|
||||
|
||||
function ReaderFooter:applyFooterMode(mode)
|
||||
-- three modes switcher for reader footer
|
||||
|
||||
@@ -321,7 +321,7 @@ function ReaderUI:init()
|
||||
v()
|
||||
end
|
||||
|
||||
-- After initialisation notify that document is loaded
|
||||
-- After initialisation notify that document is loaded and rendered
|
||||
-- CREngine only reports correct page count after rendering is done
|
||||
-- Need the same event for PDF document
|
||||
self:handleEvent(Event:new("ReaderReady", self.doc_settings))
|
||||
|
||||
Reference in New Issue
Block a user