refactored targetNote to workNote in the ScriptContext which was very confusing with relation's targetNote

This commit is contained in:
azivner
2018-08-01 10:12:54 +02:00
parent 2d24bf81dd
commit 6dc934abbe
7 changed files with 16 additions and 16 deletions

View File

@@ -1,13 +1,13 @@
import ScriptApi from './script_api.js';
import utils from './utils.js';
function ScriptContext(startNote, allNotes, targetNote = null) {
function ScriptContext(startNote, allNotes, workNote = null) {
const modules = {};
return {
modules: modules,
notes: utils.toObject(allNotes, note => [note.noteId, note]),
apis: utils.toObject(allNotes, note => [note.noteId, ScriptApi(startNote, note, targetNote)]),
apis: utils.toObject(allNotes, note => [note.noteId, ScriptApi(startNote, note, workNote)]),
require: moduleNoteIds => {
return moduleName => {
const candidates = allNotes.filter(note => moduleNoteIds.includes(note.noteId));