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
477e2464
Commit
477e2464
authored
8 years ago
by
Yannis Barlas
Browse files
Options
Downloads
Patches
Plain Diff
selection around notes does not open tooltip
parent
f1963032
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/components/SimpleEditor/elements/note/EditNoteTool.js
+26
-8
26 additions, 8 deletions
app/components/SimpleEditor/elements/note/EditNoteTool.js
app/components/SimpleEditor/elements/note/note.scss
+7
-4
7 additions, 4 deletions
app/components/SimpleEditor/elements/note/note.scss
with
33 additions
and
12 deletions
app/components/SimpleEditor/elements/note/EditNoteTool.js
+
26
−
8
View file @
477e2464
import
{
each
,
includes
,
keys
}
from
'
lodash
'
import
{
each
,
includes
,
keys
}
from
'
lodash
'
import
{
documentHelpers
,
Tool
,
ProseEditorConfigurator
as
Configurator
,
import
{
EditorSession
}
from
'
substance
'
documentHelpers
,
EditorSession
,
ProseEditorConfigurator
as
Configurator
,
Tool
}
from
'
substance
'
import
MiniEditor
from
'
../../miniEditor/miniEditor
'
import
MiniEditor
from
'
../../miniEditor/miniEditor
'
import
config
from
'
../../miniEditor/config
'
import
config
from
'
../../miniEditor/config
'
...
@@ -8,7 +12,6 @@ import Importer from '../../SimpleEditorImporter'
...
@@ -8,7 +12,6 @@ import Importer from '../../SimpleEditorImporter'
import
SimpleExporter
from
'
../../SimpleEditorExporter
'
import
SimpleExporter
from
'
../../SimpleEditorExporter
'
class
EditNoteTool
extends
Tool
{
class
EditNoteTool
extends
Tool
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
)
super
(
props
)
this
.
saveNote
=
this
.
saveNote
.
bind
(
this
)
this
.
saveNote
=
this
.
saveNote
.
bind
(
this
)
...
@@ -16,12 +19,16 @@ class EditNoteTool extends Tool {
...
@@ -16,12 +19,16 @@ class EditNoteTool extends Tool {
render
(
$$
)
{
render
(
$$
)
{
const
miniEditorSession
=
this
.
_initMiniEditor
()
const
miniEditorSession
=
this
.
_initMiniEditor
()
let
el
=
$
$
(
'
div
'
).
addClass
(
'
sc-edit-note-tool
'
)
const
selected
=
this
.
getSelection
()
const
selected
=
this
.
getSelection
()
let
el
=
$
$
(
'
div
'
).
addClass
(
'
sc-edit-note-tool
'
)
if
(
!
selected
.
node
)
return
el
if
(
!
selected
.
node
)
return
el
el
.
append
(
$
$
(
MiniEditor
,
{
el
.
append
(
$
$
(
MiniEditor
,
{
editorSession
:
miniEditorSession
editorSession
:
miniEditorSession
}))
}))
return
el
return
el
}
}
...
@@ -87,18 +94,29 @@ class EditNoteTool extends Tool {
...
@@ -87,18 +94,29 @@ class EditNoteTool extends Tool {
const
session
=
this
.
context
.
editorSession
const
session
=
this
.
context
.
editorSession
const
sel
=
session
.
getSelection
()
const
sel
=
session
.
getSelection
()
const
note
=
documentHelpers
.
getPropertyAnnotationsForSelection
(
const
note
s
=
documentHelpers
.
getPropertyAnnotationsForSelection
(
session
.
getDocument
(),
session
.
getDocument
(),
sel
,
sel
,
{
type
:
'
note
'
}
{
type
:
'
note
'
}
)
)
const
note
=
notes
[
0
]
let
show
=
false
if
(
typeof
note
!==
'
undefined
'
)
{
if
((
sel
.
start
.
offset
===
note
.
start
.
offset
&&
sel
.
end
.
offset
===
note
.
end
.
offset
))
{
show
=
true
}
}
// disable when larger selection that just includes a note as well
// disable when larger selection that just includes a note as well
const
selectionLength
=
(
sel
.
end
.
offset
-
sel
.
start
.
offset
===
1
)
// const selectionLength = (sel.end.offset - sel.start.offset === 1)
// if (sel.end.offset - sel.)
if
(
typeof
note
[
0
]
!==
'
undefined
'
&&
selectionLength
)
{
if
(
show
)
{
return
{
return
{
node
:
note
[
0
]
node
:
note
}
}
}
else
{
}
else
{
return
{
return
{
...
...
This diff is collapsed.
Click to expand it.
app/components/SimpleEditor/elements/note/note.scss
+
7
−
4
View file @
477e2464
$gray
:
#eee
;
$gray
:
#eee
;
$red
:
#591818
;
$red
:
#591818
;
// .hidden {
// display: none;
// }
.sc-prose-editor
{
.sc-prose-editor
{
counter-reset
:
note
;
counter-reset
:
note
;
.sm-note
{
display
:
inline-block
;
}
.sc-note
{
.sc-note
{
color
:
$red
;
color
:
$red
;
display
:
inline-block
;
// TODO -- is this correct?
display
:
block
;
font-weight
:
bold
;
font-weight
:
bold
;
user-select
:
initial
;
}
}
.
sc-note
:
:
after
{
.
sc-note
:
:
after
{
...
...
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