13 lines
No EOL
300 B
TypeScript
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 = ``;
|
|
};
|
|
}; |