Also add touch-action: none to the main document

This commit is contained in:
Kovid Goyal 2020-02-18 08:29:22 +05:30
parent ea7ad6fc0a
commit 1c9db87492
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 2 deletions

View File

@ -67,7 +67,9 @@ def init_ui():
install(translations)
remove_initial_progress_bar()
document.head.appendChild(E.style(get_widget_css()))
set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground'))
# See https://github.com/kovidgoyal/calibre/pull/1101
# for why we need touch-action: none
set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground'), touch_action='none')
document.body.appendChild(E.div())
document.body.lastChild.appendChild(E.div(id=book_list_container_id, style='display: none'))
document.body.lastChild.appendChild(E.div(id=read_book_container_id, style='display: none'))

View File

@ -408,7 +408,9 @@ if window is window.top:
window.onerror = onerror
create_modal_container()
document.head.appendChild(E.style(get_widget_css()))
set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground'))
# See https://github.com/kovidgoyal/calibre/pull/1101
# for why we need touch-action: none
set_css(document.body, background_color=get_color('window-background'), color=get_color('window-foreground'), touch_action='none')
setTimeout(def():
window.onpopstate = on_pop_state
, 0) # We do this after event loop ticks over to avoid catching popstate events that some browsers send on page load