mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Server: Fix tooltip not working in the cover grid view.
Fixes #1708760 [Feature request: add book title as hover to web grid ui](https://bugs.launchpad.net/calibre/+bug/1708760)
This commit is contained in:
parent
6b01b4a24a
commit
3482f15c15
@ -64,9 +64,10 @@ def on_img_load(img, load_type):
|
|||||||
def create_item(book_id, metadata, create_image, show_book_details):
|
def create_item(book_id, metadata, create_image, show_book_details):
|
||||||
authors = metadata.authors.join(' & ') if metadata.authors else _('Unknown')
|
authors = metadata.authors.join(' & ') if metadata.authors else _('Unknown')
|
||||||
img = create_image(book_id, THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_HEIGHT, on_img_load)
|
img = create_image(book_id, THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_HEIGHT, on_img_load)
|
||||||
img.setAttribute('alt', _('{} by {}').format(metadata.title, authors))
|
tooltip = _('{} by {}').format(metadata.title, authors)
|
||||||
|
img.setAttribute('alt', tooltip)
|
||||||
img.dataset.title, img.dataset.authors = metadata.title, authors
|
img.dataset.title, img.dataset.authors = metadata.title, authors
|
||||||
ans = E.div(img, onclick=show_book_details)
|
ans = E.div(img, onclick=show_book_details, title=tooltip)
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
def append_item(container, item):
|
def append_item(container, item):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user