mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 14:43:38 +02: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
1 changed files with 7 additions and 6 deletions
|
|
@ -38,12 +38,13 @@ def apply_colors():
|
|||
|
||||
|
||||
def apply_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 ''
|
||||
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
|
||||
|
||||
|
||||
def apply_settings():
|
||||
|
|
|
|||
Loading…
Reference in a new issue