diff --git a/app/components/SimpleEditor/elements/isolatedNote/IsolatedNote.js b/app/components/SimpleEditor/elements/isolatedNote/IsolatedNote.js index 559a37ea74af8a32d426514111ee17b4e7e5436e..d56e33c1ce35c4048a9ad4cff41918f4a4603b82 100644 --- a/app/components/SimpleEditor/elements/isolatedNote/IsolatedNote.js +++ b/app/components/SimpleEditor/elements/isolatedNote/IsolatedNote.js @@ -14,4 +14,6 @@ IsolatedNote.define({ }, content: 'text' }) +IsolatedNote.mode = 'focused' +IsolatedNote.unblocked = true export default IsolatedNote diff --git a/app/components/SimpleEditor/elements/isolatedNote/IsolatedNoteComponent.js b/app/components/SimpleEditor/elements/isolatedNote/IsolatedNoteComponent.js index 0ad0e0f95ec683367ab484e9c4f529e7e4cfc6cf..2332bb8c5a2d9617cf047d15df84df8be14c05e6 100644 --- a/app/components/SimpleEditor/elements/isolatedNote/IsolatedNoteComponent.js +++ b/app/components/SimpleEditor/elements/isolatedNote/IsolatedNoteComponent.js @@ -1,15 +1,16 @@ -import { BlockNodeComponent } from 'substance' +import { IsolatedNodeComponent } from 'substance' import TextPropertyEditor from './TextPropertyEditor' -class IsolatedNoteComponent extends BlockNodeComponent { +class IsolatedNoteComponent extends IsolatedNodeComponent { render ($$) { let el = $$('div').addClass('sc-entity') + el.attr('data-id', this.props.node.id) el.append( $$(TextPropertyEditor, { path: [this.props.node.id, 'content'], - disabled: this.context.editor.props.disabled, + disabled: this.props.disabled, tagName: 'p', - multiLine: true + multiLine: false }).ref('noteContentEditor-' + this.props.node.id)) return el diff --git a/app/components/SimpleEditor/elements/isolatedNote/IsolatedNotePackage.js b/app/components/SimpleEditor/elements/isolatedNote/IsolatedNotePackage.js index 9aa292f23db1500642a7fbc045603471a2879aa8..e64f68163aa1cb52b9e273e2e43213a228944f33 100644 --- a/app/components/SimpleEditor/elements/isolatedNote/IsolatedNotePackage.js +++ b/app/components/SimpleEditor/elements/isolatedNote/IsolatedNotePackage.js @@ -3,7 +3,6 @@ import IsolatedNoteComponent from './IsolatedNoteComponent' import IsolatedNoteHTMLConverter from './IsolatedNoteHTMLConverter' import IsolatedNoteCommand from './IsolatedNoteCommand' import IsolatedNoteTool from './IsolatedNoteTool' -// import {InsertInlineNodeCommand} from 'substance' export default { name: 'isolated-note', diff --git a/app/components/SimpleEditor/notesEditor/NotesEditor.js b/app/components/SimpleEditor/notesEditor/NotesEditor.js index b83bd266f2f94ab5f53112c0ad74dee0af36e7d7..304c73f076de4985f1b0c17ecae588a3236f0f16 100644 --- a/app/components/SimpleEditor/notesEditor/NotesEditor.js +++ b/app/components/SimpleEditor/notesEditor/NotesEditor.js @@ -152,20 +152,20 @@ class NotesEditor extends ProseEditor { const selection = this.editorSession.getSelection() if (selection.start && selection.start.offset === 0 && selection.end.offset === 0) { this.editorSession.setSelection(null) + this.context.editorSession.setSelection(null) } - + const exporter = new SimpleExporter(this.props.configurator.config) const convertedNode = exporter.convertNode(isolatedNote) this.context.editorSession.transaction(function (tx, args) { const path = [isolatedNote.parentNoteId, 'note-content'] - tx.set(path, convertedNode.outerHTML) + tx.set(path, convertedNode.innerHTML) }) } findNote () { const selection = this.editorSession.getSelection() if (!selection.end) return - const isolatedNoteId = selection.end.path[0] const isolatedNote = this.editorSession.document.get(isolatedNoteId) return this.saveNote(isolatedNote) diff --git a/app/components/SimpleEditor/panes/Notes/Notes.js b/app/components/SimpleEditor/panes/Notes/Notes.js index 99a6d1bb22ec865f5566df4aec4edc2661995156..7acbdd5b6fefff17efc1ffe02c8fd2c79d0a48b0 100644 --- a/app/components/SimpleEditor/panes/Notes/Notes.js +++ b/app/components/SimpleEditor/panes/Notes/Notes.js @@ -59,7 +59,7 @@ class Notes extends Component { for (var i = 0; i < notes.length; i++) { let isolatedNoteElement = exporter.createElement('isolated-note') - isolatedNoteElement.setAttribute('parent-note-id', notes[i].id) + isolatedNoteElement.setAttribute('data-parent-id', notes[i].id) isolatedNoteElement.innerHTML = notes[i]['note-content'] noteContent += isolatedNoteElement.outerHTML }