Commit 806336fc by Яков

add glossary

parent 41d4e8d8
...@@ -1248,27 +1248,31 @@ const QEditor = ({ ...@@ -1248,27 +1248,31 @@ const QEditor = ({
) )
} }
})} })}
<div {
key={'bubbleItems-glossary'} window.location.pathname.includes('admin/maps') &&
className={ <div
'qicon qglossary' key={'bubbleItems-glossary'}
} className={
title={'Добавить в глоссарий'} 'qicon qglossary'
onClick={()=>{
if (!editor.state.selection.empty) {
const selectedText = editor.state.doc.textBetween(
editor.state.selection.from,
editor.state.selection.to,
" "
);
setWordGlossary(selectedText);
setTimeout(()=>{
setModalGlossaryIsOpen(true);
}, 100)
} }
// console.log(editor.chain().focus()); title={'Добавить в глоссарий'}
}} onClick={()=>{
/> if (!editor.state.selection.empty) {
const selectedText = editor.state.doc.textBetween(
editor.state.selection.from,
editor.state.selection.to,
" "
);
setWordGlossary(selectedText);
setTimeout(()=>{
setModalGlossaryIsOpen(true);
}, 100)
}
// console.log(editor.chain().focus());
}}
/>
}
</div> </div>
</BubbleMenu> </BubbleMenu>
<EditorContent editor={editor} className='atma-editor-content'/> <EditorContent editor={editor} className='atma-editor-content'/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment