Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wax-prosemirror
Manage
Activity
Members
Labels
Plan
Issues
34
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
2
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
wax
wax-prosemirror
Commits
08fcc13f
Commit
08fcc13f
authored
4 years ago
by
chris
Browse files
Options
Downloads
Patches
Plain Diff
comments on notes fix
parent
3b46ee6d
No related branches found
No related tags found
1 merge request
!169
Remove views
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
wax-prosemirror-components/src/components/rightArea/RightArea.js
+6
-3
6 additions, 3 deletions
...semirror-components/src/components/rightArea/RightArea.js
wax-prosemirror-services/src/NoteService/NoteComponent.js
+6
-3
6 additions, 3 deletions
wax-prosemirror-services/src/NoteService/NoteComponent.js
with
12 additions
and
6 deletions
wax-prosemirror-components/src/components/rightArea/RightArea.js
+
6
−
3
View file @
08fcc13f
...
...
@@ -16,6 +16,7 @@ export default ({ area }) => {
}
=
useContext
(
WaxContext
);
const
commentPlugin
=
app
.
PmPlugins
.
get
(
'
commentPlugin
'
);
const
[
marksNodes
,
setMarksNodes
]
=
useState
([]);
const
[
position
,
setPosition
]
=
useState
();
const
[
isFirstRun
,
setFirstRun
]
=
useState
(
true
);
...
...
@@ -63,12 +64,15 @@ export default ({ area }) => {
markNodeEl
.
getBoundingClientRect
().
top
-
panelWrapperHeight
-
50
;
}
let
boxEl
=
null
;
// get height of this markNode box
const
boxEl
=
document
.
querySelector
(
`div[data-box="
${
id
}
"]`
);
if
(
markNodeEl
)
{
boxEl
=
document
.
querySelector
(
`div[data-box="
${
id
}
"]`
);
}
if
(
boxEl
)
boxHeight
=
parseInt
(
boxEl
.
offsetHeight
,
10
);
// where the box should move to
top
=
annotationTop
;
top
=
boxEl
?
annotationTop
:
-
2000
;
// if the above comment box has already taken up the height, move down
if
(
pos
>
0
)
{
...
...
@@ -156,7 +160,6 @@ export default ({ area }) => {
return
<>
{
CommentTrackComponent
}
<
/>
;
};
// TODO if allInlineNodes and allBlockNodes count don't change, do not compute again
const
updateMarks
=
view
=>
{
if
(
view
.
main
)
{
const
allInlineNodes
=
[];
...
...
This diff is collapsed.
Click to expand it.
wax-prosemirror-services/src/NoteService/NoteComponent.js
+
6
−
3
View file @
08fcc13f
import
React
,
{
useContext
,
useState
,
useMemo
}
from
'
react
'
;
import
useDeepCompareEffect
from
'
use-deep-compare-effect
'
;
import
{
differenceBy
}
from
'
lodash
'
;
import
{
WaxContext
}
from
'
wax-prosemirror-core
'
;
import
{
DocumentHelpers
}
from
'
wax-prosemirror-utilities
'
;
import
NoteEditor
from
'
./NoteEditor
'
;
...
...
@@ -22,14 +22,17 @@ export default () => {
);
if
(
notes
.
length
>
currentNotes
.
length
)
{
// TODO remove from context views that no loger exist
// console.log('to do cleanup');
const
difference
=
differenceBy
(
notes
,
currentNotes
,
'
node.attrs.id
'
);
difference
.
forEach
((
item
,
i
)
=>
{
// delete view[item.node.attrs.id];
});
}
}
};
useDeepCompareEffect
(()
=>
{
setNotes
(
updateNotes
(
main
));
cleanUpNoteViews
();
//
cleanUpNoteViews();
},
[
updateNotes
(
main
)]);
const
noteComponent
=
useMemo
(
...
...
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