toggle left panel command + menu

This commit is contained in:
Jan Prochazka
2021-04-17 21:04:22 +02:00
parent 28bbf9a01e
commit f92df5c326

View File

@@ -28,6 +28,15 @@
onClick: () => getCurrentEditor().switchToView('table'), onClick: () => getCurrentEditor().switchToView('table'),
}); });
registerCommand({
id: 'dataGrid.toggleLeftPanel',
category: 'Data grid',
name: 'Toggle left panel',
keyText: 'Ctrl+L',
testEnabled: () => getCurrentEditor() != null,
onClick: () => getCurrentEditor().toggleLeftPanel(),
});
function extractMacroValuesForMacro(macroValues, macro) { function extractMacroValuesForMacro(macroValues, macro) {
// return {}; // return {};
if (!macro) return {}; if (!macro) return {};
@@ -121,10 +130,15 @@
} }
} }
export function toggleLeftPanel() {
collapsedLeftColumnStore.update(x => !x);
}
registerMenu( registerMenu(
{ command: 'dataGrid.switchToForm', tag: 'switch', hideDisabled: true }, { command: 'dataGrid.switchToForm', tag: 'switch', hideDisabled: true },
{ command: 'dataGrid.switchToTable', tag: 'switch', hideDisabled: true }, { command: 'dataGrid.switchToTable', tag: 'switch', hideDisabled: true },
{ command: 'dataGrid.switchToJson', tag: 'switch', hideDisabled: true } { command: 'dataGrid.switchToJson', tag: 'switch', hideDisabled: true },
{ command: 'dataGrid.toggleLeftPanel', tag: 'switch' }
); );
</script> </script>