mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-25 20:40:36 +03:00
Small UI fixes
This commit is contained in:
parent
ac85bfdba7
commit
65872cbce7
|
@ -15,6 +15,7 @@ import DlgEditReference from '@/dialogs/DlgEditReference';
|
|||
import { ReferenceType } from '@/models/language';
|
||||
import { IRSForm } from '@/models/rsform';
|
||||
import { CodeMirrorWrapper } from '@/utils/codemirror';
|
||||
import { PARAMETER } from '@/utils/constants';
|
||||
|
||||
import { NaturalLanguage, ReferenceTokens } from './parse';
|
||||
import { RefEntity } from './parse/parser.terms';
|
||||
|
@ -165,12 +166,17 @@ const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
|||
[thisRef]
|
||||
);
|
||||
|
||||
const hideEditReference = useCallback(() => {
|
||||
setShowEditor(false);
|
||||
setTimeout(() => thisRef.current?.view?.focus(), PARAMETER.refreshTimeout);
|
||||
}, [thisRef]);
|
||||
|
||||
return (
|
||||
<div className={clsx('flex flex-col gap-2', cursor)}>
|
||||
<AnimatePresence>
|
||||
{showEditor && schema ? (
|
||||
<DlgEditReference
|
||||
hideWindow={() => setShowEditor(false)}
|
||||
hideWindow={hideEditReference}
|
||||
schema={schema}
|
||||
initial={{
|
||||
type: currentType,
|
||||
|
@ -193,7 +199,7 @@ const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
|||
value={isFocused ? value : value !== initialValue || showEditor ? value : resolved}
|
||||
indentWithTab={false}
|
||||
onChange={handleChange}
|
||||
editable={!disabled}
|
||||
editable={!disabled && !showEditor}
|
||||
onKeyDown={handleInput}
|
||||
onFocus={handleFocusIn}
|
||||
onBlur={handleFocusOut}
|
||||
|
|
|
@ -145,9 +145,11 @@ function RSTabs() {
|
|||
|
||||
const onOpenCst = useCallback(
|
||||
(cstID: ConstituentaID) => {
|
||||
navigateTab(RSTabID.CST_EDIT, cstID);
|
||||
if (cstID !== activeCst?.id) {
|
||||
navigateTab(RSTabID.CST_EDIT, cstID);
|
||||
}
|
||||
},
|
||||
[navigateTab]
|
||||
[navigateTab, activeCst]
|
||||
);
|
||||
|
||||
const onDestroySchema = useCallback(() => {
|
||||
|
|
|
@ -16,6 +16,7 @@ export const PARAMETER = {
|
|||
smallScreen: 640, // == tailwind:xs
|
||||
smallTreeNodes: 50, // amount of nodes threshold for size increase for large graphs
|
||||
refreshTimeout: 100, // milliseconds delay for post-refresh actions
|
||||
minimalTimeout: 10, // milliseconds delay for fast updates
|
||||
graphRefreshDelay: 10, // milliseconds delay for graph viewpoint reset
|
||||
|
||||
logicLabel: 'LOGIC'
|
||||
|
|
Loading…
Reference in New Issue
Block a user