diff --git a/public/src/components/Dropdown/Dropdown.tsx b/public/src/components/Dropdown/Dropdown.tsx index 8b1c78a5..1fbbaceb 100644 --- a/public/src/components/Dropdown/Dropdown.tsx +++ b/public/src/components/Dropdown/Dropdown.tsx @@ -2,7 +2,6 @@ import {ScReact} from '@veglem/screact'; import './Dropdown.sass'; import {Img} from '../Image/Image'; import {AppDispatcher} from '../../modules/dispatcher'; -import {AppNoteStore, NoteStoreActions} from '../../modules/stores/NoteStore'; import {AppNotesStore, NotesActions} from '../../modules/stores/NotesStore'; import {MAX_ATTACH_SIZE} from '../../utils/consts'; import {AppToasts} from '../../modules/toasts'; @@ -47,9 +46,6 @@ export class Dropdown extends ScReact.Component { }; handleOnClick = (id:string) => { - let tag = id; - let attr = null; - let content = []; if (id === "h1") { insertBlockPlugin('header', 'h1') diff --git a/public/src/components/NoteEditor/NoteEditor.tsx b/public/src/components/NoteEditor/NoteEditor.tsx index 172140da..cbd029fa 100644 --- a/public/src/components/NoteEditor/NoteEditor.tsx +++ b/public/src/components/NoteEditor/NoteEditor.tsx @@ -133,13 +133,6 @@ export class NoteEditor extends ScReact.Component { - this.setState(state => ({ - ...state, - inviteUserModalOpen: false - })) - } - openParentNote = () => { AppDispatcher.dispatch(NotesActions.OPEN_NOTE, this.state.selectedNote.parent) } @@ -230,16 +223,22 @@ export class NoteEditor extends ScReact.Component { + console.log("openDropdown") const editor = this.editorWrapperRef + console.log("editor.clientHeight: ", editor.clientHeight) + console.log("elem.getBoundingClientRect().top: ", elem.getBoundingClientRect().top) const offsetBottom = editor.clientHeight - elem.getBoundingClientRect().top - const dropdownOffsetTop = offsetBottom < 205 ? -225 : 40 + console.log("offsetBottom: ", offsetBottom) + const dropdownOffsetTop = offsetBottom < 205 ? -420 : -145 + console.log("dropdownOffsetTop: ", dropdownOffsetTop) + console.log("elem.offsetTop: ", elem.offsetTop) this.setState(state => ({ ...state, dropdownOpen: true, dropdownPos: { left: elem.offsetLeft + 20, - top: elem.offsetTop + dropdownOffsetTop + top: elem.getBoundingClientRect().top + dropdownOffsetTop } })) }