From 61b4f755261c4cdac643ca7651ebfba07834c509 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 23 Oct 2015 19:59:45 +0530 Subject: [PATCH] Zoom cover on hover --- src/pyj/book_list/views.pyj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/views.pyj b/src/pyj/book_list/views.pyj index 635fa64705..e1b5b90df9 100644 --- a/src/pyj/book_list/views.pyj +++ b/src/pyj/book_list/views.pyj @@ -1,7 +1,7 @@ # vim:fileencoding=utf-8 # License: GPL v3 Copyright: 2015, Kovid Goyal -from dom import set_css +from dom import set_css, build_rule from elementmaker import E from gettext import gettext as _ @@ -18,9 +18,10 @@ class BooksView: self.search_result = interface_data['search_result'] self.metadata_map = interface_data['metadata'] self.container_id = 'books-view-' + bv_counter + style = build_rule('#' + self.container_id + ' .cover_grid img:hover', transform='scale(1.2)') div = E.div( id=self.container_id, style='display:block', - E.style(), + E.style(style), E.div(), E.div(id='get-more-books') ) @@ -68,6 +69,7 @@ class BooksView: def init_cover_grid(self): div = self.grid set_css(div, display='flex', flex_wrap='wrap', justify_content='flex-start', align_items='flex-end', align_content='flex-start') + div.setAttribute('class', 'cover_grid') self.cover_grid_width = self.cover_grid_height = -1 def resize_cover_grid(self):