Skip to content
Snippets Groups Projects
Commit ea19a557 authored by chris's avatar chris Committed by john
Browse files

note tool not needed on click of not callout send to provider

parent 5bada9f4
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ class EditNoteTool extends Tool { ...@@ -13,7 +13,7 @@ class EditNoteTool extends Tool {
let el = $$('div').addClass('sc-edit-note-tool') let el = $$('div').addClass('sc-edit-note-tool')
if (!selected.node) return el if (!selected.node) return el
provider.config.miniEditorContext.editor.emit('noteSelected', 'paragraph-71bf75436a5f9b56700064c6ee2116ab') provider.config.miniEditorContext.editor.emit('noteSelected', 'paragraph-71bf75436a5f9b56700064c6ee2116ab')
return el return el
} }
......
...@@ -6,12 +6,20 @@ class NoteComponent extends Component { ...@@ -6,12 +6,20 @@ class NoteComponent extends Component {
render ($$) { render ($$) {
const el = $$('note') const el = $$('note')
.attr('note-content', this.props.node['note-content']) .attr('note-content', this.props.node['note-content'])
.addClass('sc-note') .addClass('sc-note').on('click', this.createShowNote)
// .append('a')
return el return el
} }
createShowNote () {
const provider = this.getProvider()
provider.createShowNote()
}
getProvider () {
return this.context.notesProvider
}
dispose () { dispose () {
this.props.node.off(this) this.props.node.off(this)
} }
......
import EditNoteTool from './EditNoteTool'
import Note from './Note' import Note from './Note'
import NoteCommand from './NoteCommand' import NoteCommand from './NoteCommand'
import NoteComponent from './NoteComponent' import NoteComponent from './NoteComponent'
...@@ -14,7 +13,6 @@ export default { ...@@ -14,7 +13,6 @@ export default {
config.addConverter('html', NoteHTMLConverter) config.addConverter('html', NoteHTMLConverter)
config.addCommand(Note.type, NoteCommand, { nodeType: Note.type }) config.addCommand(Note.type, NoteCommand, { nodeType: Note.type })
config.addTool('note', NoteTool, { toolGroup: 'annotations' }) config.addTool('note', NoteTool, { toolGroup: 'annotations' })
config.addTool('note', EditNoteTool, { toolGroup: 'overlay' })
config.addIcon('note', { 'fontawesome': 'fa-bookmark' }) config.addIcon('note', { 'fontawesome': 'fa-bookmark' })
config.addLabel('note', { config.addLabel('note', {
en: 'Note' en: 'Note'
......
...@@ -23,48 +23,3 @@ $red: #591818; ...@@ -23,48 +23,3 @@ $red: #591818;
font-weight: 400; font-weight: 400;
} }
} }
.sc-edit-note-tool-container {
background-color: $gray;
border: 1px solid $red;
display: inline-block;
.sc-save-area {
display: inline;
float: left;
height: 100%;
padding: 5px 5px 0;
width: 40px;
.sc-save-icon {
color: $red;
cursor: pointer;
position: absolute;
right: 19px;
top: 17px;
&:hover {
color: $red;
}
}
}
textarea {
background-color: $gray;
border: transparent;
border-right: 1px dashed $red;
color: $red;
float: left;
font-family: 'Fira Sans';
font-size: 15px;
min-height: 39px;
outline: none;
overflow: hidden;
resize: none;
width: 310px;
&[disabled] {
border-right: 0;
}
}
}
...@@ -75,6 +75,10 @@ class NotesProvider extends TOCProvider { ...@@ -75,6 +75,10 @@ class NotesProvider extends TOCProvider {
return notes return notes
// return _.sortBy(notes, ['blockPosition', 'nodePosition']) // return _.sortBy(notes, ['blockPosition', 'nodePosition'])
} }
createShowNote () {
console.log('in provider')
}
} }
NotesProvider.tocTypes = ['note'] NotesProvider.tocTypes = ['note']
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment