0
0
Fork 0
file-hider/src/utils.ts

13 lines
No EOL
300 B
TypeScript

export function changePathVisibility(path: string, hide: boolean) {
let escapedPath = CSS.escape(path);
let n = document.querySelector(`[data-path="${escapedPath}"]`);
if (!n) {
return;
};
let p = n.parentElement
if (hide) {
p.style.display = `none`
} else {
p.style.display = ``;
};
};