Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mirador annotations
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Loïs Poujade
Mirador annotations
Commits
89cf5a20
Unverified
Commit
89cf5a20
authored
3 years ago
by
Camille Villa
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #56 from ProjectMirador/tweaks
parents
21f92f50
9beec6f8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.eslintrc
+3
-1
3 additions, 1 deletion
.eslintrc
src/AnnotationCreation.js
+7
-1
7 additions, 1 deletion
src/AnnotationCreation.js
src/TextEditor.js
+14
-1
14 additions, 1 deletion
src/TextEditor.js
with
24 additions
and
3 deletions
.eslintrc
+
3
−
1
View file @
89cf5a20
...
...
@@ -26,6 +26,8 @@
"sort-keys": ["error", "asc", {
"caseSensitive": false,
"natural": false
}]
}],
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off"
}
}
This diff is collapsed.
Click to expand it.
src/AnnotationCreation.js
+
7
−
1
View file @
89cf5a20
...
...
@@ -244,7 +244,7 @@ class AnnotationCreation extends Component {
updateGeometry
=
{
this
.
updateGeometry
}
windowId
=
{
windowId
}
/
>
<
form
onSubmit
=
{
this
.
submitForm
}
>
<
form
onSubmit
=
{
this
.
submitForm
}
className
=
{
classes
.
section
}
>
<
Grid
container
>
<
Grid
item
xs
=
{
12
}
>
<
Typography
variant
=
"
overline
"
>
...
...
@@ -431,6 +431,12 @@ const styles = (theme) => ({
display
:
'
flex
'
,
flexWrap
:
'
wrap
'
,
},
section
:
{
paddingBottom
:
theme
.
spacing
(
1
),
paddingLeft
:
theme
.
spacing
(
2
),
paddingRight
:
theme
.
spacing
(
1
),
paddingTop
:
theme
.
spacing
(
2
),
},
});
AnnotationCreation
.
propTypes
=
{
...
...
This diff is collapsed.
Click to expand it.
src/TextEditor.js
+
14
−
1
View file @
89cf5a20
...
...
@@ -20,6 +20,16 @@ class TextEditor extends Component {
this
.
onChange
=
this
.
onChange
.
bind
(
this
);
this
.
handleKeyCommand
=
this
.
handleKeyCommand
.
bind
(
this
);
this
.
handleFormating
=
this
.
handleFormating
.
bind
(
this
);
this
.
handleFocus
=
this
.
handleFocus
.
bind
(
this
);
this
.
editorRef
=
React
.
createRef
();
}
/**
* This is a kinda silly hack (but apparently recommended approach) to
* making sure the whole visible editor area is clickable, not just the first line.
*/
handleFocus
()
{
if
(
this
.
editorRef
.
current
)
this
.
editorRef
.
current
.
focus
();
}
/** */
...
...
@@ -58,6 +68,7 @@ class TextEditor extends Component {
const
{
classes
}
=
this
.
props
;
const
{
editorState
}
=
this
.
state
;
const
currentStyle
=
editorState
.
getCurrentInlineStyle
();
return
(
<
div
>
<
ToggleButtonGroup
...
...
@@ -77,11 +88,13 @@ class TextEditor extends Component {
<
ItalicIcon
/>
<
/ToggleButton
>
<
/ToggleButtonGroup
>
<
div
className
=
{
classes
.
editorRoot
}
>
<
div
className
=
{
classes
.
editorRoot
}
onClick
=
{
this
.
handleFocus
}
>
<
Editor
editorState
=
{
editorState
}
handleKeyCommand
=
{
this
.
handleKeyCommand
}
onChange
=
{
this
.
onChange
}
ref
=
{
this
.
editorRef
}
/
>
<
/div
>
<
/div
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment