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
1e3f7084
Commit
1e3f7084
authored
8 years ago
by
chris
Committed by
john
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
create overlapping comments
parent
ddb5866d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/SimpleEditor/elements/comment/CommentBubble.js
+4
-2
4 additions, 2 deletions
...components/SimpleEditor/elements/comment/CommentBubble.js
app/components/SimpleEditor/panes/Comments/CommentsProvider.js
+9
-3
9 additions, 3 deletions
...omponents/SimpleEditor/panes/Comments/CommentsProvider.js
with
13 additions
and
5 deletions
app/components/SimpleEditor/elements/comment/CommentBubble.js
+
4
−
2
View file @
1e3f7084
...
...
@@ -10,8 +10,10 @@ class CommentBubble extends Tool {
const
mode
=
this
.
getMode
()
const
title
=
'
Create a new comment
'
if
(
mode
!==
'
create
'
)
return
$
$
(
'
div
'
)
// if (mode !== 'create') return $$('div')
if
(
mode
===
'
delete
'
||
mode
===
'
fuse
'
)
return
$
$
(
'
div
'
)
// console.log('bubble commands', commands.mode)
const
icon
=
$
$
(
Icon
,
{
icon
:
'
fa-comment
'
})
.
addClass
(
'
sc-comment-icon
'
)
...
...
@@ -120,7 +122,7 @@ class CommentBubble extends Tool {
const
selection
=
this
.
getSelection
()
const
surface
=
this
.
getSurface
()
if
(
mode
!
==
'
crea
te
'
)
return
if
(
mode
=
==
'
dele
te
'
)
return
const
newNode
=
{
selection
:
selection
,
...
...
This diff is collapsed.
Click to expand it.
app/components/SimpleEditor/panes/Comments/CommentsProvider.js
+
9
−
3
View file @
1e3f7084
...
...
@@ -50,7 +50,10 @@ class CommentsProvider extends TocProvider {
// if the new selection is a comment, make it activeEntry
const
activeEntry
=
this
.
getActiveEntry
()
const
commentState
=
this
.
getCommentState
()
const
onComment
=
commentState
.
active
// is current selection on a comment
// TODO why on any mode except delete active is false???
if
(
commentState
.
mode
===
'
fuse
'
)
commentState
.
active
=
true
console
.
log
(
'
provider commands
'
,
commentState
)
let
onComment
=
commentState
.
active
// is current selection on a comment
if
(
!
onComment
&&
!
activeEntry
)
return
...
...
@@ -61,6 +64,7 @@ class CommentsProvider extends TocProvider {
}
const
activeComment
=
this
.
getActiveComment
()
console
.
log
(
'
whichhhh
'
,
activeComment
.
id
)
if
(
activeEntry
===
activeComment
.
id
)
return
this
.
setActiveEntry
(
activeComment
.
id
)
}
...
...
@@ -143,9 +147,11 @@ class CommentsProvider extends TocProvider {
getActiveComment
()
{
const
selectionState
=
this
.
config
.
documentSession
.
getSelectionState
()
const
commentAnnotations
=
selectionState
.
getAnnotationsForType
(
'
comment
'
)
console
.
log
(
'
selection
'
,
this
.
config
.
documentSession
.
getSelection
())
const
count
=
commentAnnotations
.
length
-
1
console
.
log
(
count
)
// TODO -- what happens with multiple comments on the same cursor position?
return
commentAnnotations
[
0
]
return
commentAnnotations
[
count
]
}
getComments
()
{
...
...
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