mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Forgot to pass event to container title bar callback
This commit is contained in:
parent
12bee0e3cd
commit
92d9c9055d
@ -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
|
||||
|
@ -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()
|
||||
event.stopPropagation()
|
||||
overlay.hide_current_panel(event)
|
||||
)
|
||||
def action():
|
||||
event = this
|
||||
event.stopPropagation()
|
||||
overlay.hide_current_panel(event)
|
||||
|
||||
create_top_bar(container, title=title, icon='close', action=action)
|
||||
|
||||
|
||||
class MainOverlay: # {{{
|
||||
|
Loading…
x
Reference in New Issue
Block a user