Adds "Better rendering of list items" to Style tweaks (#3968)

Alternate rendering of list items as block elements (instead of
inline/final).
Check the built DOM is still coherent with styles on stylesheet
change, and propose to reload the document if not. Also
invalidate cache on close in that case so a new DOM is built
at next opening.
ReaderStyleTweak: fix tweak css duplication; when globally
enabled, when disabling and re-enabling locally, the css would
be added twice to the final CSS.
Also adds !important to "sub_sup_smaller" tweak, and increase
its priority so it can override "font_size_all_inherit".
Adds CreDocument:getCacheFilePath() for futur features.
This commit is contained in:
poire-z
2018-05-21 01:19:36 +02:00
committed by GitHub
parent 6a98dbaec7
commit 07713be429
7 changed files with 113 additions and 39 deletions

View File

@@ -650,4 +650,17 @@ function ReaderUI:onHome()
return true
end
function ReaderUI:reloadDocument(after_close_callback)
local file = self.document.file
local provider = getmetatable(self.document).__index
self:handleEvent(Event:new("CloseReaderMenu"))
self:handleEvent(Event:new("CloseConfigMenu"))
self:onClose()
if after_close_callback then
-- allow caller to do stuff between close an re-open
after_close_callback(file, provider)
end
self:showReader(file, provider)
end
return ReaderUI