mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #1960227 [[Enhancement - Content server] Don't display arrows on the cover on the Book details page if there are no previous/next book](https://bugs.launchpad.net/calibre/+bug/1960227)
This commit is contained in:
parent
22aaea6073
commit
d5201ff24d
@ -513,12 +513,17 @@ def render_book(container_id, book_id):
|
|||||||
button_style += 'display: none;'
|
button_style += 'display: none;'
|
||||||
|
|
||||||
def prev_next_button(is_prev):
|
def prev_next_button(is_prev):
|
||||||
|
delta = -1 if is_prev else 1
|
||||||
|
nbid = book_after(book_id, delta)
|
||||||
|
s = button_style
|
||||||
|
if not nbid or nbid is book_id:
|
||||||
|
s += '; display: none'
|
||||||
return E.div(
|
return E.div(
|
||||||
style=button_style,
|
style=s,
|
||||||
title=_('Previous book [Ctrl+Left]') if is_prev else _('Next book [Ctrl+Right]'),
|
title=_('Previous book [Ctrl+Left]') if is_prev else _('Next book [Ctrl+Right]'),
|
||||||
class_='next-book-button',
|
class_='next-book-button',
|
||||||
svgicon('chevron-left' if is_prev else 'chevron-right'),
|
svgicon('chevron-left' if is_prev else 'chevron-right'),
|
||||||
onclick=next_book.bind(None, book_id, (-1 if is_prev else 1))
|
onclick=next_book.bind(None, book_id, delta)
|
||||||
)
|
)
|
||||||
|
|
||||||
imgdiv = E.div(style='position: relative',
|
imgdiv = E.div(style='position: relative',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user