From 30bcd2ab8f2615758e03700d2bceea31c3ebd8f8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Nov 2015 21:23:25 +0530 Subject: [PATCH] ... --- src/pyj/book_list/views.pyj | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index df5eca60cc..b44a4f5677 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -161,11 +161,13 @@ class BooksView: cover_url = str.format('get/thumb/{}/{}?sz={}x{}', book_id, self.interface_data['library_id'], THUMBNAIL_MAX_WIDTH, THUMBNAIL_MAX_HEIGHT) metadata = self.interface_data['metadata'][book_id] alt = str.format(_('{} by {}'), metadata['title'], metadata['authors'].join(' & ')) - img = E.img(alt=alt, title=alt, data_title=metadata['title'], data_authors=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: 100%; max-height: 100%; display: block; width:auto; height:auto') img.onerror = def(err): img = err.target div = img.parentNode + if not div: + return clear(div) div.appendChild(E.div( style='position:relative; top:-50%; transform: translateY(50%)', @@ -175,7 +177,6 @@ class BooksView: )) set_css(div, border='dashed 1px currentColor', border_radius='10px') - img.setAttribute('src', cover_url) return E.div( style=str.format(('margin: 10px; display: flex; align-content: flex-end; align-items: flex-end; justify-content: space-around;' 'width: 21vw; height: 28vw; max-width: {}px; max-height: {}px; min-width: {}px; min-height: {}px; cursor:pointer'),