mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
set self.css to nil when there is no external css
This commit is contained in:
@@ -14,6 +14,7 @@ function ReaderTypeset:onReadSettings(config)
|
||||
self.ui.document:setStyleSheet(self.css)
|
||||
else
|
||||
self.ui.document:setStyleSheet("")
|
||||
self.css = nil
|
||||
end
|
||||
|
||||
self.embedded_css = config:readSetting("embedded_css")
|
||||
@@ -41,7 +42,7 @@ function ReaderTypeset:genStyleSheetMenu()
|
||||
{
|
||||
text = "clear all external styles",
|
||||
callback = function()
|
||||
self:setStyleSheet("")
|
||||
self:setStyleSheet(nil)
|
||||
end
|
||||
},
|
||||
{
|
||||
@@ -67,8 +68,11 @@ end
|
||||
function ReaderTypeset:setStyleSheet(new_css)
|
||||
if new_css ~= self.css then
|
||||
--DEBUG("setting css to ", new_css)
|
||||
self.ui.document:setStyleSheet(new_css)
|
||||
self.css = new_css
|
||||
if new_css == nil then
|
||||
new_css = ""
|
||||
end
|
||||
self.ui.document:setStyleSheet(new_css)
|
||||
self.ui:handleEvent(Event:new("UpdatePos"))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user