diff --git a/frontend/src/components/grid.svelte b/frontend/src/components/grid.svelte index 8ee7cf0..675c495 100644 --- a/frontend/src/components/grid.svelte +++ b/frontend/src/components/grid.svelte @@ -45,11 +45,10 @@ dispatch('selectChild', childKey); } - function toggleChildren(itemKey, closeAll) { + function toggleChildren(itemKey, shift) { childrenOpen[itemKey] = !childrenOpen[itemKey]; - if (closeAll) { - childrenOpen = {}; - dispatch('closeAll'); + if (shift) { + closeAll(); } } @@ -81,6 +80,11 @@ } return String(value).slice(0, 1000) + '…'; } + + function closeAll() { + childrenOpen = {}; + dispatch('closeAll'); + }
0} class:contained> @@ -150,7 +154,7 @@ items={item.children} level={level + 1} on:select={e => selectChild(item[key], e.detail)} - on:closeAll={() => (childrenOpen = {})} + on:closeAll={closeAll} />