mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Ensure iframe is focused after controls help is shown
This commit is contained in:
parent
102be318d8
commit
b480086d00
@ -80,4 +80,5 @@ ui_operations = {
|
|||||||
'update_font_size': None,
|
'update_font_size': None,
|
||||||
'goto_bookpos': None,
|
'goto_bookpos': None,
|
||||||
'delete_book': None,
|
'delete_book': None,
|
||||||
|
'focus_iframe': None,
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ class ReadUI:
|
|||||||
ui_operations.update_font_size = self.update_font_size.bind(self)
|
ui_operations.update_font_size = self.update_font_size.bind(self)
|
||||||
ui_operations.goto_bookpos = self.goto_bookpos.bind(self)
|
ui_operations.goto_bookpos = self.goto_bookpos.bind(self)
|
||||||
ui_operations.delete_book = self.delete_book.bind(self)
|
ui_operations.delete_book = self.delete_book.bind(self)
|
||||||
|
ui_operations.focus_iframe = self.focus_iframe.bind(self)
|
||||||
|
|
||||||
def on_resize(self):
|
def on_resize(self):
|
||||||
self.view.on_resize()
|
self.view.on_resize()
|
||||||
@ -162,6 +163,9 @@ class ReadUI:
|
|||||||
def delete_book(self, book, proceed):
|
def delete_book(self, book, proceed):
|
||||||
self.db.delete_book(book, proceed)
|
self.db.delete_book(book, proceed)
|
||||||
|
|
||||||
|
def focus_iframe(self):
|
||||||
|
self.view.focus_iframe()
|
||||||
|
|
||||||
def update_color_scheme(self):
|
def update_color_scheme(self):
|
||||||
self.view.update_color_scheme()
|
self.view.update_color_scheme()
|
||||||
|
|
||||||
|
@ -48,6 +48,7 @@ def show_controls_help():
|
|||||||
show_controls_help.listener_added = True
|
show_controls_help.listener_added = True
|
||||||
container.addEventListener('click', def():
|
container.addEventListener('click', def():
|
||||||
document.getElementById('controls-help-overlay').style.display = 'none'
|
document.getElementById('controls-help-overlay').style.display = 'none'
|
||||||
|
ui_operations.focus_iframe()
|
||||||
)
|
)
|
||||||
def msg(txt):
|
def msg(txt):
|
||||||
return set_css(E.div(txt), padding='1ex 1em', text_align='center', margin='auto')
|
return set_css(E.div(txt), padding='1ex 1em', text_align='center', margin='auto')
|
||||||
|
@ -251,6 +251,8 @@ if window is window.top:
|
|||||||
view.update_color_scheme()
|
view.update_color_scheme()
|
||||||
ui_operations.update_font_size = def():
|
ui_operations.update_font_size = def():
|
||||||
view.update_font_size()
|
view.update_font_size()
|
||||||
|
ui_operations.focus_iframe = def():
|
||||||
|
view.focus_iframe()
|
||||||
ui_operations.goto_bookpos = def(cfi):
|
ui_operations.goto_bookpos = def(cfi):
|
||||||
return view.goto_bookpos(cfi)
|
return view.goto_bookpos(cfi)
|
||||||
ui_operations.toggle_toc = def():
|
ui_operations.toggle_toc = def():
|
||||||
@ -267,6 +269,7 @@ if window is window.top:
|
|||||||
to_python.report_cfi(request_id, data)
|
to_python.report_cfi(request_id, data)
|
||||||
ui_operations.ask_for_open = def(path):
|
ui_operations.ask_for_open = def(path):
|
||||||
to_python.ask_for_open(path)
|
to_python.ask_for_open(path)
|
||||||
|
|
||||||
document.body.appendChild(E.div(id='view'))
|
document.body.appendChild(E.div(id='view'))
|
||||||
window.onerror = onerror
|
window.onerror = onerror
|
||||||
create_modal_container()
|
create_modal_container()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user