mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
Add move hotkeys
This commit is contained in:
parent
03fd5d054b
commit
ea6bf7224c
|
@ -66,10 +66,11 @@ function EditorConstituenta({ activeCst, isModified, setIsModified, onOpenEdit }
|
|||
}
|
||||
|
||||
function processAltKey(code: string): boolean {
|
||||
// prettier-ignore
|
||||
switch (code) {
|
||||
case 'KeyV':
|
||||
controller.cloneCst();
|
||||
return true;
|
||||
case 'ArrowUp': controller.moveUp(); return true;
|
||||
case 'ArrowDown': controller.moveDown(); return true;
|
||||
case 'KeyV': controller.cloneCst(); return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ function EditorRSList({ onOpenEdit }: EditorRSListProps) {
|
|||
}
|
||||
}
|
||||
|
||||
function handleTableKey(event: React.KeyboardEvent<HTMLDivElement>) {
|
||||
function handleKeyDown(event: React.KeyboardEvent<HTMLDivElement>) {
|
||||
if (!controller.isContentEditable || controller.isProcessing) {
|
||||
return;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ function EditorRSList({ onOpenEdit }: EditorRSListProps) {
|
|||
return (
|
||||
<>
|
||||
{controller.isContentEditable ? <RSListToolbar /> : null}
|
||||
<AnimateFade tabIndex={-1} className='outline-none' onKeyDown={handleTableKey}>
|
||||
<AnimateFade tabIndex={-1} className='outline-none' onKeyDown={handleKeyDown}>
|
||||
{controller.isContentEditable ? (
|
||||
<SelectedCounter
|
||||
totalCount={controller.schema?.stats?.count_all ?? 0}
|
||||
|
|
Loading…
Reference in New Issue
Block a user