mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Fix needing to restart viewer for changes in the background image
This commit is contained in:
parent
d9061421e4
commit
77a0a77723
2 changed files with 2 additions and 3 deletions
|
|
@ -442,7 +442,7 @@ def get_color_scheme(self, apply_to_margins):
|
|||
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…
Reference in a new issue