mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix needing to restart viewer for changes in the background image
This commit is contained in:
parent
d9061421e4
commit
77a0a77723
@ -442,7 +442,7 @@ class View:
|
||||
self.iframe.style.backgroundColor = ans.background or 'white'
|
||||
bg_image = sd.get('background_image')
|
||||
if bg_image:
|
||||
self.iframe.style.backgroundImage = f'url({READER_BACKGROUND_URL})' if runtime.is_standalone_viewer else f'url({bg_image})'
|
||||
self.iframe.style.backgroundImage = f'url({READER_BACKGROUND_URL}?{Date().getTime()})' if runtime.is_standalone_viewer else f'url({bg_image})'
|
||||
else:
|
||||
self.iframe.style.backgroundImage = 'none'
|
||||
if sd.get('background_image_style') is 'scaled':
|
||||
|
@ -241,8 +241,7 @@ def get_current_cfi(request_id):
|
||||
def background_image_changed(img_id):
|
||||
img = document.getElementById(img_id)
|
||||
if img:
|
||||
img.src = ''
|
||||
img.src = READER_BACKGROUND_URL
|
||||
img.src = READER_BACKGROUND_URL + '?' + Date().getTime()
|
||||
|
||||
|
||||
def onerror(msg, script_url, line_number, column_number, error_object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user