mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure book details and book readers start with window scrolled to top
This commit is contained in:
parent
67f95c3e1d
commit
fdb98fdb4e
@ -449,6 +449,7 @@ def check_for_books_loaded():
|
||||
def init(container_id):
|
||||
container = document.getElementById(container_id)
|
||||
create_top_bar(container, title=_('Book details'), action=back, icon='close')
|
||||
window.scrollTo(0, 0) # Ensure we are at the top of the window
|
||||
container.appendChild(E.div(class_=CLASS_NAME))
|
||||
container.lastChild.appendChild(E.div(_('Loading books from the calibre library, please wait...'), style='margin: 1ex 1em'))
|
||||
conditional_timeout(container_id, 5, check_for_books_loaded)
|
||||
|
@ -415,6 +415,7 @@ class ReadUI:
|
||||
current_state = self.url_data
|
||||
same = current_query.library_id is current_state.library_id and str(current_query.book_id) is str(current_state.book_id) and current_query.fmt is current_state.fmt
|
||||
self.view.overlay.hide()
|
||||
window.scrollTo(0, 0) # Ensure we are at the top of the window
|
||||
if same:
|
||||
if current_state.bookpos is not current_query.bookpos and current_query.bookpos:
|
||||
self.view.goto_bookpos(current_query.bookpos)
|
||||
|
Loading…
x
Reference in New Issue
Block a user