mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix re-opening a book in the content server viewer not preserving last read position
Fixes #1891328
This commit is contained in:
parent
f34b132c69
commit
f758320251
@ -303,7 +303,10 @@ class MainOverlay: # {{{
|
||||
class_=MAIN_OVERLAY_ACTIONS_CLASS
|
||||
)
|
||||
if not runtime.is_standalone_viewer:
|
||||
home_action = ac(_('Home'), _('Return to the home page'), def(): home();, 'home')
|
||||
home_action = ac(_('Home'), _('Return to the home page'), def():
|
||||
home()
|
||||
ui_operations.close_book()
|
||||
, 'home')
|
||||
library_action = ac(_('Library'), _('Return to the library page'), self.overlay.show_library, 'library')
|
||||
actions_div.insertBefore(E.ul(home_action, library_action), actions_div.firstChild)
|
||||
full_screen_actions = []
|
||||
@ -769,6 +772,7 @@ class Overlay:
|
||||
self.hide_current_panel()
|
||||
book = self.view.book
|
||||
show_panel('book_list', {'library_id': book.key[0], 'book_id': book.key[1] + ''}, replace=False)
|
||||
ui_operations.close_book()
|
||||
|
||||
def show_font_size_chooser(self):
|
||||
self.hide_current_panel()
|
||||
|
@ -80,6 +80,7 @@ class ReadUI:
|
||||
ui_operations.wait_for_messages_from = self.wait_for_messages_from.bind(self)
|
||||
ui_operations.stop_waiting_for_messages_from = self.stop_waiting_for_messages_from.bind(self)
|
||||
ui_operations.update_metadata = self.update_metadata.bind(self)
|
||||
ui_operations.close_book = self.close_book.bind(self)
|
||||
ui_operations.open_url = def(url):
|
||||
window.open(url, '_blank')
|
||||
ui_operations.copy_selection = def(text):
|
||||
@ -155,6 +156,9 @@ class ReadUI:
|
||||
div = document.getElementById(self.progress_id)
|
||||
div.lastChild.textContent = msg or ''
|
||||
|
||||
def close_book(self):
|
||||
self.base_url_data = {}
|
||||
|
||||
def load_book(self, library_id, book_id, fmt, metadata, force_reload):
|
||||
self.base_url_data = {'library_id': library_id, 'book_id':book_id, 'fmt':fmt}
|
||||
if not self.db.initialized:
|
||||
|
Loading…
x
Reference in New Issue
Block a user