Forgot to pass event to container title bar callback

This commit is contained in:
Kovid Goyal 2021-02-05 12:02:32 +05:30
parent 12bee0e3cd
commit 92d9c9055d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 6 deletions

View File

@ -71,7 +71,10 @@ def set_left_data(container, title='calibre', icon='heart', action=None, tooltip
a.setAttribute('href', interface_data.donate_link)
a.setAttribute('target', 'donate-to-calibre')
if action is not None:
a.addEventListener('click', def(event): event.preventDefault(), action();)
a.addEventListener('click', def(event):
event.preventDefault()
action.bind(event)()
)
if callable(title_action):
a = a.nextSibling

View File

@ -220,11 +220,12 @@ add_extra_css(def():
def simple_overlay_title(title, overlay, container):
container.style.backgroundColor = get_color('window-background')
create_top_bar(container, title=title, icon='close', action=def (event):
event.preventDefault()
def action():
event = this
event.stopPropagation()
overlay.hide_current_panel(event)
)
create_top_bar(container, title=title, icon='close', action=action)
class MainOverlay: # {{{