mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Only add element for user stylesheet if needed and add it to html rather
than body
This commit is contained in:
parent
62810e5111
commit
599d3dbddc
@ -38,12 +38,13 @@ def apply_colors():
|
|||||||
|
|
||||||
|
|
||||||
def apply_stylesheet():
|
def apply_stylesheet():
|
||||||
sid = 'calibre-browser-viewer-user-stylesheet'
|
if opts.user_stylesheet:
|
||||||
style = document.getElementById(sid)
|
sid = 'calibre-browser-viewer-user-stylesheet'
|
||||||
if not style:
|
style = document.getElementById(sid)
|
||||||
style = E.style(type='text/css', id=sid)
|
if not style:
|
||||||
document.body.appendChild(style)
|
style = E.style(type='text/css', id=sid)
|
||||||
style.textContent = opts.user_stylesheet or ''
|
document.documentElement.appendChild(style)
|
||||||
|
style.textContent = opts.user_stylesheet
|
||||||
|
|
||||||
|
|
||||||
def apply_settings():
|
def apply_settings():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user