separated text and code handling out of note detail service

This commit is contained in:
azivner
2018-03-27 00:22:02 -04:00
parent 7e856283ee
commit 68921ee59b
7 changed files with 205 additions and 153 deletions

View File

@@ -1,5 +1,5 @@
import treeService from './tree.js';
import noteDetailService from './note_detail.js';
import noteDetailText from './note_detail_text.js';
import treeUtils from './tree_utils.js';
function getNotePathFromLink(url) {
@@ -75,14 +75,14 @@ function goToLink(e) {
}
function addLinkToEditor(linkTitle, linkHref) {
const editor = noteDetailService.getEditor();
const editor = noteDetailText.getEditor();
const doc = editor.document;
doc.enqueueChanges(() => editor.data.insertLink(linkTitle, linkHref), doc.selection);
}
function addTextToEditor(text) {
const editor = noteDetailService.getEditor();
const editor = noteDetailText.getEditor();
const doc = editor.document;
doc.enqueueChanges(() => editor.data.insertText(text), doc.selection);