mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
fix: only show reader status at the end of the book
This commit is contained in:
@@ -21,6 +21,10 @@ function ReaderStatus:init()
|
||||
self.enabled = false
|
||||
return
|
||||
end
|
||||
-- register event listener if enabled
|
||||
self.onEndOfBook = function()
|
||||
self:showStatus()
|
||||
end
|
||||
self.total_pages = self.document:getPageCount()
|
||||
self.ui:registerPostInitCallback(function()
|
||||
self.ui.menu:registerToMainMenu(self)
|
||||
@@ -48,19 +52,6 @@ function ReaderStatus:showStatus()
|
||||
UIManager:show(status_page)
|
||||
end
|
||||
|
||||
function ReaderStatus:onPageUpdate(pageno)
|
||||
if self.enabled then
|
||||
--in case when pageUpdate event generated before _document:render()
|
||||
if pageno > self.total_pages or self.total_pages == 1 then
|
||||
self.total_pages = self.document:getPageCount()
|
||||
end
|
||||
|
||||
if pageno == self.total_pages and self.total_pages ~= 1 then
|
||||
self:showStatus()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ReaderStatus:onReadSettings(config)
|
||||
self.settings = config
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user