From daf89ef4bc51e761dad31b4f92c340efbd3807ef Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 15 May 2017 20:47:23 +0530 Subject: [PATCH] Fix clickin on thje details part of books list items not working --- src/pyj/book_list/details_list.pyj | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pyj/book_list/details_list.pyj b/src/pyj/book_list/details_list.pyj index 0ff4aa9ecb..b29961e6f6 100644 --- a/src/pyj/book_list/details_list.pyj +++ b/src/pyj/book_list/details_list.pyj @@ -31,7 +31,10 @@ def details_list_css(): s = sel + ' .details-list-right' ans += build_rule(s, flex_grow='10', overflow='hidden', display='flex', flex_direction='column') s += ' iframe' - ans += build_rule(s, flex_grow='10', height='50px') + # To enable clicking anywhere on the item to load book details to work, we + # have to set pointer-events: none + # That has the side effect of disabling text selection + ans += build_rule(s, flex_grow='10', height='50px', cursor='pointer', pointer_events='none') return ans @@ -89,9 +92,9 @@ def create_item(book_id, metadata, create_image, show_book_details): ) ans = E.div(img_div, right, style=f'height:{THUMBNAIL_MAX_HEIGHT}px; display: flex', - onclick=show_book_details, class_=ITEM_CLASS, ) + ans.addEventListener('click', show_book_details, True) return ans