mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Add button to return to books page at top level of controls
This commit is contained in:
parent
512c1e34b3
commit
896df3daf9
@ -319,7 +319,8 @@ class MainOverlay: # {{{
|
|||||||
ui_operations.close_book()
|
ui_operations.close_book()
|
||||||
, 'home')
|
, 'home')
|
||||||
library_action = ac(_('Library'), _('Return to the library page'), self.overlay.show_library, 'library')
|
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)
|
book_action = ac(_('Book'), _('Return to the book\'s page'), self.overlay.show_book_page, 'book')
|
||||||
|
actions_div.insertBefore(E.ul(home_action, library_action, book_action), actions_div.firstChild)
|
||||||
full_screen_actions = []
|
full_screen_actions = []
|
||||||
if runtime.is_standalone_viewer:
|
if runtime.is_standalone_viewer:
|
||||||
text = _('Exit full screen') if runtime.viewer_in_full_screen else _('Enter full screen')
|
text = _('Exit full screen') if runtime.viewer_in_full_screen else _('Enter full screen')
|
||||||
@ -848,6 +849,11 @@ class Overlay:
|
|||||||
show_panel('book_list', {'library_id': book.key[0], 'book_id': book.key[1] + ''}, replace=False)
|
show_panel('book_list', {'library_id': book.key[0], 'book_id': book.key[1] + ''}, replace=False)
|
||||||
ui_operations.close_book()
|
ui_operations.close_book()
|
||||||
|
|
||||||
|
def show_book_page(self):
|
||||||
|
self.hide_current_panel()
|
||||||
|
self.view.open_book_page()
|
||||||
|
ui_operations.close_book()
|
||||||
|
|
||||||
def show_font_size_chooser(self):
|
def show_font_size_chooser(self):
|
||||||
self.hide_current_panel()
|
self.hide_current_panel()
|
||||||
self.panels.push(FontSizeOverlay(self))
|
self.panels.push(FontSizeOverlay(self))
|
||||||
|
@ -9,7 +9,7 @@ from ajax import ajax_send
|
|||||||
from book_list.globals import get_session_data
|
from book_list.globals import get_session_data
|
||||||
from book_list.home import update_book_in_recently_read_by_user_on_home_page
|
from book_list.home import update_book_in_recently_read_by_user_on_home_page
|
||||||
from book_list.theme import cached_color_to_rgba, get_color, set_ui_colors
|
from book_list.theme import cached_color_to_rgba, get_color, set_ui_colors
|
||||||
from book_list.ui import query_as_href
|
from book_list.ui import show_panel
|
||||||
from dom import add_extra_css, build_rule, clear, set_css, svgicon, unique_id
|
from dom import add_extra_css, build_rule, clear, set_css, svgicon, unique_id
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
from iframe_comm import create_wrapped_iframe
|
from iframe_comm import create_wrapped_iframe
|
||||||
@ -915,9 +915,7 @@ class View:
|
|||||||
def open_book_page(self):
|
def open_book_page(self):
|
||||||
# Open the page for the current book in a new tab
|
# Open the page for the current book in a new tab
|
||||||
if self.book and self.book.key:
|
if self.book and self.book.key:
|
||||||
window.open(query_as_href({
|
show_panel('book_details', {'library_id': self.book.key[0], 'book_id': self.book.key[1] + ''}, replace=False)
|
||||||
'library_id': self.book.key[0], 'book_id': self.book.key[1] + '', 'close_action': 'book_list',
|
|
||||||
}, 'book_details'))
|
|
||||||
|
|
||||||
def clear_book_resource_caches(self):
|
def clear_book_resource_caches(self):
|
||||||
self.loaded_resources = {}
|
self.loaded_resources = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user