mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Viewer: Fix restoring user stylesheet to default not being applied until a viewer restart
This commit is contained in:
parent
6ec980c99f
commit
263bb0ce88
@ -49,13 +49,14 @@ def apply_colors():
|
||||
|
||||
|
||||
def apply_stylesheet():
|
||||
if opts.user_stylesheet:
|
||||
sid = 'calibre-browser-viewer-user-stylesheet'
|
||||
style = document.getElementById(sid)
|
||||
if not style:
|
||||
style = E.style(type='text/css', id=sid)
|
||||
document.documentElement.appendChild(style)
|
||||
style.textContent = opts.user_stylesheet
|
||||
sid = 'calibre-browser-viewer-user-stylesheet'
|
||||
style = document.getElementById(sid)
|
||||
if not style:
|
||||
if not opts.user_stylesheet:
|
||||
return
|
||||
style = E.style(type='text/css', id=sid)
|
||||
document.documentElement.appendChild(style)
|
||||
style.textContent = opts.user_stylesheet
|
||||
|
||||
|
||||
def apply_settings():
|
||||
|
Loading…
x
Reference in New Issue
Block a user