Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
editoria
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yannis Barlas
editoria
Commits
31a06083
Commit
31a06083
authored
8 years ago
by
john
Browse files
Options
Downloads
Patches
Plain Diff
do not open line height for tracked changes if the user cannot resolve them
parent
5e524d1d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/components/SimpleEditor/Editor.js
+14
-8
14 additions, 8 deletions
app/components/SimpleEditor/Editor.js
with
14 additions
and
8 deletions
app/components/SimpleEditor/Editor.js
+
14
−
8
View file @
31a06083
import
{
includes
,
some
}
from
'
lodash
'
import
{
import
{
ProseEditor
,
ProseEditor
,
ProseEditorOverlayTools
,
ProseEditorOverlayTools
,
...
@@ -6,8 +8,6 @@ import {
...
@@ -6,8 +8,6 @@ import {
TOCProvider
TOCProvider
}
from
'
substance
'
}
from
'
substance
'
import
{
includes
}
from
'
lodash
'
import
Comments
from
'
./panes/Comments/CommentBoxList
'
import
Comments
from
'
./panes/Comments/CommentBoxList
'
import
CommentsProvider
from
'
./panes/Comments/CommentsProvider
'
import
CommentsProvider
from
'
./panes/Comments/CommentsProvider
'
import
ContainerEditor
from
'
./ContainerEditor
'
import
ContainerEditor
from
'
./ContainerEditor
'
...
@@ -51,7 +51,10 @@ class Editor extends ProseEditor {
...
@@ -51,7 +51,10 @@ class Editor extends ProseEditor {
}
}
render
(
$$
)
{
render
(
$$
)
{
var
el
=
$
$
(
'
div
'
).
addClass
(
'
sc-prose-editor
'
)
const
{
trackChangesView
}
=
this
.
state
const
canToggleTrackChanges
=
this
.
canToggleTrackChanges
()
const
el
=
$
$
(
'
div
'
).
addClass
(
'
sc-prose-editor
'
)
// left side: editor and toolbar
// left side: editor and toolbar
var
toolbar
=
this
.
_renderToolbar
(
$$
)
var
toolbar
=
this
.
_renderToolbar
(
$$
)
...
@@ -109,7 +112,10 @@ class Editor extends ProseEditor {
...
@@ -109,7 +112,10 @@ class Editor extends ProseEditor {
)
)
)
)
if
(
this
.
state
.
trackChangesView
&&
!
this
.
isAuthor
())
el
.
addClass
(
'
track-changes-mode
'
)
if
(
trackChangesView
&&
canToggleTrackChanges
)
{
el
.
addClass
(
'
track-changes-mode
'
)
}
return
el
return
el
}
}
...
@@ -135,10 +141,10 @@ class Editor extends ProseEditor {
...
@@ -135,10 +141,10 @@ class Editor extends ProseEditor {
}
}
}
}
isAuthor
()
{
canToggleTrackChanges
()
{
const
author
=
includes
(
this
.
props
.
user
.
roles
,
'
author
'
)
const
{
user
}
=
this
.
props
const
accepted
=
[
'
admin
'
,
'
production-editor
'
,
'
copy-editor
'
]
return
author
return
some
(
accepted
,
(
role
)
=>
includes
(
user
.
roles
,
role
))
}
}
scrollTo
(
nodeId
)
{
scrollTo
(
nodeId
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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