mirror of
https://github.com/garraflavatra/rolens.git
synced 2024-12-01 13:20:54 +00:00
*Really* close all items
This commit is contained in:
parent
6d7f35775c
commit
1d200db534
@ -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');
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class:grid={level === 0} class:subgrid={level > 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}
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user