mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix clicks on the edges of item lists not always being registered
This commit is contained in:
parent
65fd14da63
commit
7bd82c0206
@ -40,13 +40,12 @@ def build_list(container, items, subtitle):
|
|||||||
if item.icon:
|
if item.icon:
|
||||||
ic = svgicon(item.icon)
|
ic = svgicon(item.icon)
|
||||||
ic = E.span(ic, '\xa0')
|
ic = E.span(ic, '\xa0')
|
||||||
ul.appendChild(E.li(E.a(href='javascript:void(0)',
|
ul.appendChild(E.li(
|
||||||
E.div(ic, item.title, class_='item-title')
|
E.div(ic, item.title, class_='item-title')
|
||||||
)))
|
))
|
||||||
a = ul.lastChild.firstChild
|
div = ul.lastChild.firstChild
|
||||||
if item.subtitle:
|
if item.subtitle:
|
||||||
a.appendChild(E.div(item.subtitle, class_='item-subtitle', style='padding-top:1ex'))
|
div.appendChild(E.div(item.subtitle, class_='item-subtitle', style='padding-top:1ex'))
|
||||||
a.addEventListener('click', def(event): event.preventDefault();)
|
|
||||||
if item.action:
|
if item.action:
|
||||||
ul.lastChild.addEventListener('click', item.action)
|
ul.lastChild.addEventListener('click', item.action)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user