Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
kotahi
Kotahi
Commits
627aa508
Commit
627aa508
authored
Oct 21, 2021
by
Ben Whitmore
Browse files
Merge branch 'wax-quick-fixes' into 'main'
Wax quick fixes See merge request
!299
parents
5ea3f65c
0ebaef6d
Pipeline
#26849
failed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/components/component-submit/src/components/Submit.js
View file @
627aa508
...
...
@@ -67,7 +67,7 @@ const Submit = ({
content
:
(
<
EditorSection
manuscript
=
{
manuscript
}
on
Change
=
{
source
=>
updateManuscript
(
versionId
,
{
meta
:
{
source
}
})}
on
Blur
=
{
source
=>
updateManuscript
(
versionId
,
{
meta
:
{
source
}
})}
readonly
=
{
!
userCanEditManuscriptAndFormData
}
/
>
),
...
...
app/components/wax-collab/src/EditorElements.js
View file @
627aa508
...
...
@@ -393,4 +393,46 @@ export default css`
.math-node.ProseMirror-selectednode .math-render {
display: none;
}
/* added for figure weirdness */
figure {
border: 1px solid
${
darken
(
'
colorPrimary
'
,
1
)}
;
margin-bottom: 1rem;
padding: 1rem;
position: relative;
}
figure::before {
color:
${
darken
(
'
colorPrimary
'
,
1
)}
;
content: 'Figure:';
font-size: 75%;
left: 0;
letter-spacing: 0.5px;
position: absolute;
text-transform: uppercase;
top: -1.25rem;
}
figure:hover:before {
content: 'Click to add a caption';
}
figcaption {
border: 1px solid
${
darken
(
'
colorPrimary
'
,
1
)}
;
margin-top: 1rem;
padding: 1rem;
position: relative;
}
figcaption::before {
color:
${
darken
(
'
colorPrimary
'
,
1
)}
;
content: 'Caption:';
font-size: 75%;
left: 0;
letter-spacing: 0.5px;
position: absolute;
text-transform: uppercase;
top: -1.25rem;
}
`
app/components/wax-collab/src/FullWaxEditor.js
View file @
627aa508
import
React
,
{
useCallback
,
useContext
}
from
'
react
'
import
React
,
{
useContext
}
from
'
react
'
import
PropTypes
from
'
prop-types
'
import
{
debounce
}
from
'
lodash
'
//
import { debounce } from 'lodash'
import
{
Wax
,
WaxContext
,
ComponentPlugin
}
from
'
wax-prosemirror-core
'
import
{
DefaultSchema
,
DocumentHelpers
}
from
'
wax-prosemirror-utilities
'
import
styled
,
{
css
}
from
'
styled-components
'
...
...
@@ -326,7 +326,7 @@ const FullWaxEditor = ({
fileUpload
,
...
rest
})
=>
{
const
debounceChange
=
useCallback
(
debounce
(
onChange
??
(()
=>
{}),
1000
),
[])
//
const debounceChange = useCallback(debounce(onChange ?? (() => {}), 1000), [])
return
(
<
div
className
=
{
validationStatus
}
>
<
Wax
...
...
@@ -338,7 +338,7 @@ const FullWaxEditor = ({
onChange
&&
onChange
(
val
)
onBlur
&&
onBlur
(
val
)
}}
onChange
=
{
debounceChange
}
/*
onChange={debounceChange}
*/
placeholder
=
{
placeholder
}
readonly
=
{
readonly
}
value
=
{
value
}
...
...
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