mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Move scrollbar suppression into the load pipeline and only suppress until load is completed
This commit is contained in:
parent
0ccedfdcc7
commit
7e49092f17
@ -260,6 +260,10 @@ class IframeBoss:
|
|||||||
self.content_loaded_stage2()
|
self.content_loaded_stage2()
|
||||||
|
|
||||||
def content_loaded_stage2(self):
|
def content_loaded_stage2(self):
|
||||||
|
# this is the loading styles used to suppress scrollbars during load
|
||||||
|
# added in unserialize_html
|
||||||
|
document.head.firstChild.textContent = ''
|
||||||
|
|
||||||
self.connect_links()
|
self.connect_links()
|
||||||
self.content_ready = True
|
self.content_ready = True
|
||||||
csi = current_spine_item()
|
csi = current_spine_item()
|
||||||
|
@ -239,6 +239,7 @@ def unserialize_html(serialized_data, proceed, postprocess_dom):
|
|||||||
head, body = tree[1], tree[2] # noqa: unused-local
|
head, body = tree[1], tree[2] # noqa: unused-local
|
||||||
clear(document.head, document.body)
|
clear(document.head, document.body)
|
||||||
remove_all_attributes(document.head, document.body)
|
remove_all_attributes(document.head, document.body)
|
||||||
|
document.head.appendChild(E.style(type='text/css', 'html::-webkit-scrollbar, body::-webkit-scrollbar { display: none !important }'))
|
||||||
# Default stylesheet
|
# Default stylesheet
|
||||||
if not runtime.is_standalone_viewer:
|
if not runtime.is_standalone_viewer:
|
||||||
# for the standalone viewer the default font family is set
|
# for the standalone viewer the default font family is set
|
||||||
|
@ -45,7 +45,7 @@ def apply_colors():
|
|||||||
else:
|
else:
|
||||||
text = ''
|
text = ''
|
||||||
|
|
||||||
ss.textContent = text + '\n\nhtml::-webkit-scrollbar, body::-webkit-scrollbar { display: none !important }'
|
ss.textContent = text
|
||||||
|
|
||||||
|
|
||||||
def apply_stylesheet():
|
def apply_stylesheet():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user