Added select all option

This commit is contained in:
sairaj mote 2022-02-16 20:21:35 +05:30
parent 557e9497ce
commit ff966be910

View File

@ -232,9 +232,19 @@
</svg> </svg>
<div id="selected_entries_no"></div> <div id="selected_entries_no"></div>
</button> </button>
<div class="flex gap-0-5">
<button class="button icon-only" title="Select all" onclick="selectAll()">
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<path d="M0 0h24v24H0V0z" fill="none" />
<path
d="M3 5h2V3c-1.1 0-2 .9-2 2zm0 8h2v-2H3v2zm4 8h2v-2H7v2zM3 9h2V7H3v2zm10-6h-2v2h2V3zm6 0v2h2c0-1.1-.9-2-2-2zM5 21v-2H3c0 1.1.9 2 2 2zm-2-4h2v-2H3v2zM9 3H7v2h2V3zm2 18h2v-2h-2v2zm8-8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2zm0-12h2V7h-2v2zm0 8h2v-2h-2v2zm-4 4h2v-2h-2v2zm0-16h2V3h-2v2zM7 17h10V7H7v10zm2-8h6v6H9V9z" />
</svg>
</button>
<button class="button" onclick="renderPreview()"> <button class="button" onclick="renderPreview()">
<svg class="icon button__icon--left" xmlns="http://www.w3.org/2000/svg" <svg class="icon button__icon--left" xmlns="http://www.w3.org/2000/svg"
enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"> enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px"
fill="#000000">
<g> <g>
<rect fill="none" height="24" width="24" /> <rect fill="none" height="24" width="24" />
<path <path
@ -244,6 +254,7 @@
Preview Preview
</button> </button>
</div> </div>
</div>
<theme-toggle></theme-toggle> <theme-toggle></theme-toggle>
<button onclick="showPopup('user_popup')" aria-label="User profile"> <button onclick="showPopup('user_popup')" aria-label="User profile">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" height="24px" viewBox="0 0 24 24" width="24px" <svg xmlns="http://www.w3.org/2000/svg" class="icon" height="24px" viewBox="0 0 24 24" width="24px"
@ -2009,6 +2020,10 @@
return composedDocumentStructure return composedDocumentStructure
} }
function selectAll() {
getRef('article_wrapper').querySelectorAll('sm-checkbox').forEach(checkbox => checkbox.checked = true)
}
function clearSelection() { function clearSelection() {
selectedContent.forEach((v, key) => { selectedContent.forEach((v, key) => {
getRef('article_wrapper').querySelector(`.content-card[data-uid="${key}"] sm-checkbox`).checked = false getRef('article_wrapper').querySelector(`.content-card[data-uid="${key}"] sm-checkbox`).checked = false