command enabling refactor

This commit is contained in:
Jan Prochazka
2021-03-15 19:33:37 +01:00
parent dfa8ca6797
commit 3b3e81e3f7
13 changed files with 207 additions and 140 deletions

View File

@@ -23,7 +23,7 @@
category: 'Tabs',
name: 'Next tab',
keyText: 'Ctrl+Tab',
enabledStore: derived(openedTabs, tabs => tabs.filter(x => !x.closedTime).length >= 2),
testEnabled: () => getOpenedTabs().filter(x => !x.closedTime).length >= 2,
onClick: () => {
const tabs = get(openedTabs).filter(x => x.closedTime == null);
if (tabs.length >= 2) setSelectedTab(tabs[tabs.length - 2].tabid);
@@ -37,7 +37,7 @@
import registerCommand from '../commands/registerCommand';
import FontIcon from '../icons/FontIcon.svelte';
import { currentDatabase, openedTabs } from '../stores';
import { currentDatabase, getOpenedTabs, openedTabs } from '../stores';
import { setSelectedTab } from '../utility/common';
import contextMenu from '../utility/contextMenu';