Small UI fixes

This commit is contained in:
IRBorisov 2024-05-28 19:48:33 +03:00
parent d7761060e7
commit 545bd97570
2 changed files with 7 additions and 2 deletions

View File

@ -31,11 +31,17 @@ function EditorLibraryItem({ item, isModified }: EditorLibraryItemProps) {
const ownerSelector = useDropdown(); const ownerSelector = useDropdown();
const onSelectUser = useCallback( const onSelectUser = useCallback(
(newValue: UserID) => { (newValue: UserID) => {
console.log(newValue);
ownerSelector.hide(); ownerSelector.hide();
if (newValue === item?.owner) { if (newValue === item?.owner) {
return; return;
} }
if (
!window.confirm(
'Вы уверены, что хотите изменить владельца? Вы потеряете право управления данной схемой. Данное действие отменить нельзя'
)
) {
return;
}
controller.setOwner(newValue); controller.setOwner(newValue);
}, },
[controller, item?.owner, ownerSelector] [controller, item?.owner, ownerSelector]

View File

@ -34,7 +34,6 @@ function ConstituentsTable({ items, activeCst, onOpenEdit, maxHeight, denseThres
} }
setTimeout(() => { setTimeout(() => {
const element = document.getElementById(`${prefixes.cst_side_table}${activeCst.alias}`); const element = document.getElementById(`${prefixes.cst_side_table}${activeCst.alias}`);
console.log(element);
if (element) { if (element) {
element.scrollIntoView({ element.scrollIntoView({
behavior: 'smooth', behavior: 'smooth',