mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:23:10 +02: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
2 changed files with 9 additions and 1 deletions
|
|
@ -303,7 +303,10 @@ def ac(text, tooltip, action, icon, is_text_button):
|
|||
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 @@ def show_library(self):
|
|||
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 @@ def __init__(self):
|
|||
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 @@ def show_progress_message(self, msg):
|
|||
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…
Reference in a new issue