Add toggle for showing hidden files

This commit is contained in:
2023-04-19 18:26:50 +02:00
parent 5803a30b6b
commit 6ae9f06d64
3 changed files with 23 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import { formatDataVolume } from "../../util/Formatting.svelte";
let dispatch = createEventDispatcher()
export let state
export let show_hidden = false
const node_icon = node => {
if (node.type === "dir") {
@@ -45,7 +46,6 @@ const node_icon = node => {
</script>
<div class="directory">
<tr>
<td></td>
@@ -57,7 +57,9 @@ const node_icon = node => {
href={state.path_root+child.path}
on:click|preventDefault={() => {dispatch("node_click", index)}}
class="node"
class:node_selected={child.fm_selected}>
class:node_selected={child.fm_selected}
class:hidden={child.name.startsWith(".") && !show_hidden}
>
<td>
<img src={node_icon(child)} class="node_icon" alt="icon"/>
</td>
@@ -131,4 +133,7 @@ td {
min-width: 50px;
white-space: nowrap;
}
.hidden {
display: none;
}
</style>