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():
|
||||
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.body.appendChild(style)
|
||||
style.textContent = opts.user_stylesheet or ''
|
||||
document.documentElement.appendChild(style)
|
||||
style.textContent = opts.user_stylesheet
|
||||
|
||||
|
||||
def apply_settings():
|
||||
|
Loading…
x
Reference in New Issue
Block a user