Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lib
react-ag-qeditor
Commits
806336fc
Commit
806336fc
authored
Apr 15, 2025
by
Яков
Browse files
add glossary
parent
41d4e8d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/QEditor.jsx
View file @
806336fc
...
...
@@ -1248,27 +1248,31 @@ const QEditor = ({
)
}
})
}
<
div
key
=
{
'
bubbleItems-glossary
'
}
className
=
{
'
qicon qglossary
'
}
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
)
{
window
.
location
.
pathname
.
includes
(
'
admin/maps
'
)
&&
<
div
key
=
{
'
bubbleItems-glossary
'
}
className
=
{
'
qicon qglossary
'
}
// 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
>
</
BubbleMenu
>
<
EditorContent
editor
=
{
editor
}
className
=
'atma-editor-content'
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment