From 4d12b972495935a932dafdda57c7e1f4fd6830c4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 13 Feb 2016 18:04:49 +0530 Subject: [PATCH] Use calc() for better sizing of cover --- src/pyj/book_list/book_details.pyj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pyj/book_list/book_details.pyj b/src/pyj/book_list/book_details.pyj index aadd370764..c947c6acf8 100644 --- a/src/pyj/book_list/book_details.pyj +++ b/src/pyj/book_list/book_details.pyj @@ -3,6 +3,7 @@ from ajax import ajax from book_list.globals import get_current_query +from book_list.theme import get_font_size from dom import clear from elementmaker import E from gettext import gettext as _ @@ -101,7 +102,7 @@ class BookDetailsPanel: alt = str.format(_('{} by {}'), metadata['title'], metadata['authors'].join(' & ')) img = E.img( src=cover_url, alt=alt, title=alt, data_title=metadata['title'], data_authors=metadata['authors'].join(' & '), - style='max-width: 45vw; max-height: 93vh; display: block; width:auto; height:auto; float:right' + style=str.format('max-width: calc(50vw - 3em); max-height: calc(100vh - 4ex - {}); display: block; width:auto; height:auto; float:right', get_font_size('title')) ) img.onerror = self.on_img_err.bind(self) c = self.container