mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-22 02:53:06 +02:00
Viewer: Fix restoring user stylesheet to default not being applied until a viewer restart
This commit is contained in:
parent
6ec980c99f
commit
263bb0ce88
1 changed files with 8 additions and 7 deletions
|
|
@ -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…
Reference in a new issue