Skip to content

Commit

Permalink
Поправил редактор
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikMix committed May 24, 2024
1 parent 7551c67 commit 30c38ad
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 28 deletions.
7 changes: 0 additions & 7 deletions public/src/components/Editor/EditorWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,3 @@ export class EditorWrapper extends Component<EditorProps, EditorState> {
)
}
}

const getFirstElem = (node) => {
if (node.nodeType === 1) {
return node;
}
return getFirstElem(node.parentElement);
}
22 changes: 1 addition & 21 deletions public/src/components/NoteEditor/NoteEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {AppNoteStore, NoteStoreActions} from '../../modules/stores/NoteStore';
import {Modal} from '../Modal/Modal';
import {DeleteNoteDialog} from '../DeleteNoteDialog/DeleteNoteDialog';
import NoteMenu from "../NoteMenu/NoteMenu";
import {InviteUserModal} from "../InviteUserModal/InviteUserModal";
import {Tooltip} from "../Tooltip/Tooltip";
import {TagList} from "../TagList/TagList";
import {EditorWrapper} from "../Editor/EditorWrapper";
Expand All @@ -19,16 +18,13 @@ import {BackgroundPicker} from "../BackgroundPicker/BackgroundPicker";
import {NoteType} from "../../utils/types";
import {SharePanel} from "../SharePanel/SharePanel";
import {PluginProps} from "../Editor/Plugin";
import {Editor} from "../Editor/Editor";
import {parseNoteTitle} from "../../modules/utils";
import {Dropdown} from "../Dropdown/Dropdown";
import YoutubeDialogForm from "../YoutubeDialog/YoutubeDialog";

type NoteEditorType = {
selectedNote: NoteType
noteStatus: string
deleteNoteModalOpen: boolean
inviteUserModalOpen: boolean
tagsModalOpen: boolean
emojiModalOpen: boolean
backgroundModalOpen: boolean
Expand All @@ -49,18 +45,17 @@ export class NoteEditor extends ScReact.Component<NoteEditorProps, NoteEditorTyp
selectedNote: null,
noteStatus: null,
deleteNoteModalOpen: false,
inviteUserModalOpen: false,
tagsModalOpen: false,
emojiModalOpen: false,
backgroundModalOpen: false,
shareModalOpen: false,
fullScreen: false,
dropdownOpen: false,
youtube: false,
dropdownPos: {
left: 0,
top: 0
},
youtube: false
};

private editorWrapperRef
Expand Down Expand Up @@ -115,15 +110,12 @@ export class NoteEditor extends ScReact.Component<NoteEditorProps, NoteEditorTyp
fullScreen: store.fullScreen
}));

console.log("updateState")
console.log(store.selectedNoteSynced)
if (store.selectedNoteSynced) {
this.setState(state => ({
...state,
noteStatus: "sync",
}));
}

};

openDeleteNoteModal = () => {
Expand All @@ -133,13 +125,6 @@ export class NoteEditor extends ScReact.Component<NoteEditorProps, NoteEditorTyp
}))
};

openInviteUserModal = () => {
this.setState(state => ({
...state,
inviteUserModalOpen: true
}))
};

closeDeleteModalDialog = () => {
this.setState(state => ({
...state,
Expand Down Expand Up @@ -308,11 +293,6 @@ export class NoteEditor extends ScReact.Component<NoteEditorProps, NoteEditorTyp
content={<DeleteNoteDialog onSuccess={this.deleteNote} handleClose={this.closeDeleteModalDialog}/>}
/>

<Modal open={this.state.inviteUserModalOpen}
handleClose={this.closeInviteUserModal}
content={<InviteUserModal handleClose={this.closeInviteUserModal} open={this.state.inviteUserModalOpen}/>}
/>

<Modal open={this.state.tagsModalOpen}
handleClose={this.closeTagsModal}
reset={false}
Expand Down

0 comments on commit 30c38ad

Please sign in to comment.