A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang. (PERSONAL FORK)
1import {updateHeader} from "../render/av/row";
2
3export const clearSelect = (types: ("av" | "img" | "cell" | "row" | "galleryItem")[], element: Element) => {
4 if (types.includes("cell")) {
5 element.querySelectorAll(".av__cell--select, .av__cell--active").forEach((item: HTMLElement) => {
6 item.querySelector(".av__drag-fill")?.remove();
7 item.classList.remove("av__cell--select", "av__cell--active");
8 });
9 }
10 if (types.includes("row")) {
11 element.querySelectorAll(".av__row--select").forEach((item: HTMLElement) => {
12 item.classList.remove("av__row--select");
13 item.querySelector(".av__firstcol use").setAttribute("xlink:href", "#iconUncheck");
14 updateHeader(item);
15 });
16 }
17 if (types.includes("galleryItem")) {
18 element.querySelectorAll(".av__gallery-item--select").forEach((item: HTMLElement) => {
19 item.classList.remove("av__gallery-item--select");
20 });
21 }
22 if (types.includes("av")) {
23 element.querySelectorAll(" .av__cell--select, .av__cell--active, .av__row--select, .av__gallery-item--select").forEach((item: HTMLElement) => {
24 if (item.classList.contains("av__row--select")) {
25 item.classList.remove("av__row--select");
26 item.querySelector(".av__firstcol use").setAttribute("xlink:href", "#iconUncheck");
27 updateHeader(item);
28 } else {
29 item.querySelector(".av__drag-fill")?.remove();
30 item.classList.remove("av__cell--select", "av__cell--active", "av__gallery-item--select");
31 }
32 });
33 }
34 if (types.includes("img")) {
35 element.querySelectorAll(".img--select").forEach((item: HTMLElement) => {
36 item.classList.remove("img--select");
37 });
38 }
39
40};