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 {
|
function processAltKey(code: string): boolean {
|
||||||
|
// prettier-ignore
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case 'KeyV':
|
case 'ArrowUp': controller.moveUp(); return true;
|
||||||
controller.cloneCst();
|
case 'ArrowDown': controller.moveDown(); return true;
|
||||||
return true;
|
case 'KeyV': controller.cloneCst(); return true;
|
||||||
}
|
}
|
||||||
return false;
|
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) {
|
if (!controller.isContentEditable || controller.isProcessing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ function EditorRSList({ onOpenEdit }: EditorRSListProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{controller.isContentEditable ? <RSListToolbar /> : null}
|
{controller.isContentEditable ? <RSListToolbar /> : null}
|
||||||
<AnimateFade tabIndex={-1} className='outline-none' onKeyDown={handleTableKey}>
|
<AnimateFade tabIndex={-1} className='outline-none' onKeyDown={handleKeyDown}>
|
||||||
{controller.isContentEditable ? (
|
{controller.isContentEditable ? (
|
||||||
<SelectedCounter
|
<SelectedCounter
|
||||||
totalCount={controller.schema?.stats?.count_all ?? 0}
|
totalCount={controller.schema?.stats?.count_all ?? 0}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user