Allow following links to local files (#4064)

Also use the new ReaderUI:switchDocument(new_file) when
already in ReaderUI in the other cases we switch document.
This commit is contained in:
poire-z
2018-07-11 18:05:30 +02:00
committed by GitHub
parent 665cb37308
commit 8c9fe9b589
4 changed files with 55 additions and 23 deletions

View File

@@ -655,6 +655,7 @@ function ReaderUI:reloadDocument(after_close_callback)
local provider = getmetatable(self.document).__index
self:handleEvent(Event:new("CloseReaderMenu"))
self:handleEvent(Event:new("CloseConfigMenu"))
self.highlight:onClose() -- close highlight dialog if any
self:onClose()
if after_close_callback then
-- allow caller to do stuff between close an re-open
@@ -666,6 +667,7 @@ end
function ReaderUI:switchDocument(new_file)
self:handleEvent(Event:new("CloseReaderMenu"))
self:handleEvent(Event:new("CloseConfigMenu"))
self.highlight:onClose() -- close highlight dialog if any
self:onClose()
self:showReader(new_file)
end