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
c6e5c1ff
Commit
c6e5c1ff
authored
7 years ago
by
Yannis Barlas
Committed by
john
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mark todos for note component
parent
7d693c6d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/components/SimpleEditor/elements/note/NoteComponent.js
+12
-4
12 additions, 4 deletions
app/components/SimpleEditor/elements/note/NoteComponent.js
with
12 additions
and
4 deletions
app/components/SimpleEditor/elements/note/NoteComponent.js
+
12
−
4
View file @
c6e5c1ff
...
...
@@ -7,15 +7,14 @@ class NoteComponent extends Component {
didMount
()
{
// TODO -- this disables the toolbar
// TODO -- unload listener on dispose
// TODO -- this gets registered once for each note -- fix
// TODO -- this gets registered once for each note -- to fix use didUpdate
// this should only call disableTools
this
.
context
.
editorSession
.
onUpdate
(
''
,
this
.
noteSelected
,
this
)
}
render
(
$$
)
{
const
noteContent
=
this
.
props
.
node
[
'
note-content
'
]
// TODO -- why note???
// const el = $$('note')
const
el
=
$
$
(
'
span
'
)
.
attr
(
'
note-content
'
,
noteContent
)
.
addClass
(
'
sc-note
'
)
...
...
@@ -26,9 +25,13 @@ class NoteComponent extends Component {
// TODO -- should this maybe be the provider's job?
noteSelected
()
{
// TODO -- we already have the note id in the props
const
selected
=
this
.
getSelection
()
if
(
get
(
selected
,
'
node.type
'
)
!==
'
note
'
)
return
// this shouldn't be here
// it should just be called when the selection updates
// not on click of the note component
this
.
disableTools
(
selected
)
const
provider
=
this
.
getProvider
()
...
...
@@ -41,11 +44,14 @@ class NoteComponent extends Component {
disableTools
()
{
const
commandStates
=
this
.
getCommandStates
()
// TODO -- this uses the same code as the fn in container editor
// use the fn from there
each
(
keys
(
commandStates
),
(
key
)
=>
{
const
allowed
=
[
'
comment
'
,
'
redo
'
,
'
save
'
,
'
switch-text-type
'
,
'
undo
'
,
'
note
'
]
const
allowed
=
[
'
comment
'
,
'
redo
'
,
'
save
'
,
'
switch-text-type
'
,
'
undo
'
]
if
(
!
includes
(
allowed
,
key
))
commandStates
[
key
].
disabled
=
true
})
// TODO -- do we need the rerender here??
this
.
rerender
()
}
...
...
@@ -62,6 +68,8 @@ class NoteComponent extends Component {
sel
,
{
type
:
'
note
'
}
)
// TODO -- scrap all below
const
note
=
notes
[
0
]
let
show
=
false
if
(
typeof
note
!==
'
undefined
'
)
{
...
...
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