From 8dc60ac2ea45518b7119b022659645706a597a4d Mon Sep 17 00:00:00 2001 From: Alex Ling Date: Sun, 2 Aug 2020 09:28:31 +0000 Subject: [PATCH] Add select all button to the selection bar --- public/js/title.js | 12 ++++++++++++ src/views/title.html.ecr | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/public/js/title.js b/public/js/title.js index 5e05613..a2eeaa8 100644 --- a/public/js/title.js +++ b/public/js/title.js @@ -191,6 +191,18 @@ const deselectAll = () => { $('#select-bar')[0].__x.$data['count'] = 0; }; +const selectAll = () => { + let count = 0; + $('.item .uk-card').each((i, e) => { + const data = e.__x.$data; + if (!data['disabled']) { + data['selected'] = true; + count++; + } + }); + $('#select-bar')[0].__x.$data['count'] = count; +}; + const selectedIDs = () => { const ary = []; $('.item .uk-card').each((i, e) => { diff --git a/src/views/title.html.ecr b/src/views/title.html.ecr index 34efc48..6cf94b7 100644 --- a/src/views/title.html.ecr +++ b/src/views/title.html.ecr @@ -12,8 +12,9 @@ -
- +
+ +