From e4fd7c58ee06dc84c003fc193968b3ed36ba35ac Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Thu, 30 Jul 2020 08:32:00 +0000 Subject: [PATCH] Add multi-select for cards in web interface --- public/js/title.js | 8 ++++++++ src/views/components/card.html.ecr | 14 +++++++++++--- src/views/title.html.ecr | 4 ++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/public/js/title.js b/public/js/title.js index 5608a3a..46fc25d 100644 --- a/public/js/title.js +++ b/public/js/title.js @@ -182,3 +182,11 @@ const setupUpload = (eid) => { } }); }; + +const deselectAll = () => { + $('.item .uk-card').each((i, e) => { + const data = e.__x.$data; + if (!data['disabled']) + data['selected'] = false; + }); +}; diff --git a/src/views/components/card.html.ecr b/src/views/components/card.html.ecr index 3eaf3bf..0e060a2 100644 --- a/src/views/components/card.html.ecr +++ b/src/views/components/card.html.ecr @@ -35,12 +35,20 @@ onclick="location='<%= base_url %>book/<%= item.id %>'" <% end %>> -
-
- + x-init="disabled = false" + <% end %>> +
+ class="grayscale" <% end %>> +
+
+ +
+
diff --git a/src/views/title.html.ecr b/src/views/title.html.ecr index 942b62f..300164c 100644 --- a/src/views/title.html.ecr +++ b/src/views/title.html.ecr @@ -1,4 +1,8 @@
+
+

+ +

<%= title.display_name %>   <% if is_admin %>