diff --git a/src/pyj/book_list/boss.pyj b/src/pyj/book_list/boss.pyj index 23ac67b92a..50a873857f 100644 --- a/src/pyj/book_list/boss.pyj +++ b/src/pyj/book_list/boss.pyj @@ -53,13 +53,17 @@ class Boss: divid = 'read-book-container' if mode is 'read_book' else 'book-list-container' for x in ['book-list-container', 'read-book-container']: document.getElementById(x).style.display = 'block' if x is divid else 'none' + self.update_window_title() @property def has_history(self): return self.history_count > 0 def update_window_title(self): - document.title = 'calibre :: ' + self.current_library_name + if self.current_mode is 'book_list': + document.title = 'calibre :: ' + self.current_library_name + elif self.current_mode is 'read_book': + document.title = self.read_ui.current_metadata.title def onerror(self, msg, script_url, line_number, column_number, error_object): try: diff --git a/src/pyj/read_book/ui.pyj b/src/pyj/read_book/ui.pyj index 4306a07d8c..40a18001f7 100644 --- a/src/pyj/read_book/ui.pyj +++ b/src/pyj/read_book/ui.pyj @@ -4,6 +4,7 @@ from ajax import ajax, encode_query from elementmaker import E from gettext import gettext as _ +from book_list.globals import get_boss from modals import error_dialog from utils import human_readable from read_book.db import create_db @@ -97,6 +98,7 @@ class ReadUI: self.current_book_id = book_id metadata = metadata or self.interface_data.metadata[book_id] self.current_metadata = metadata or {'title':_('Book id #') + book_id} + get_boss().update_window_title() self.init_ui() if type(self.db) is 'string': self.show_error(_('Cannot read book'), self.db)