{ if (item.type == 'dir') { changeModel(tree => dbKeys_markNodeExpanded(tree, item.root, !isExpanded)); } }} on:click={() => { if (item.type == 'dir') { changeModel(tree => dbKeys_markNodeExpanded(tree, item.root, !isExpanded)); } else { openNewTab({ tabComponent: 'DbKeyDetailTab', title: item.text || '(no name)', icon: 'img keydb', props: { isDefaultBrowser: true, conid, database, }, }); $activeDbKeysStore = { ...$activeDbKeysStore, [`${conid}:${database}`]: item.key, }; } }} on:mousedown={() => { $focusedTreeDbKey = _.pick(item, ['type', 'key', 'root', 'text']); }} extInfo={item.count ? `(${item.count})` : null} {indentLevel} menu={createMenu} isChoosed={$focusedTreeDbKey && item.key == $focusedTreeDbKey.key && item.root == $focusedTreeDbKey.root && item.type == $focusedTreeDbKey.type} /> {#if isExpanded} {/if}