frontend API addition to protect current note

This commit is contained in:
azivner 2019-01-01 15:39:13 +01:00
parent 6704b755d8
commit 66c639d5e3
3 changed files with 11 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import treeCache from './tree_cache.js';
import noteDetailService from './note_detail.js';
import noteTypeService from './note_type.js';
import noteTooltipService from './note_tooltip.js';
import protectedSessionService from'./protected_session.js';
/**
* This is the main frontend API interface for scripts. It's published in the local "api" object.
@ -244,7 +245,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @method
* @param {object} $el - jquery object on which to setup the tooltip
*/
this.setupElementTooltip = noteTooltipService.setupElementTooltip
this.setupElementTooltip = noteTooltipService.setupElementTooltip;
/**
* @method
*/
this.protectCurrentNote = protectedSessionService.protectNoteAndSendToServer;
}
export default FrontendScriptApi;

View file

@ -184,5 +184,6 @@ export default {
protectSubtree,
ensureDialogIsClosed,
enterProtectedSession,
leaveProtectedSession
leaveProtectedSession,
protectNoteAndSendToServer
};

View file

@ -153,7 +153,8 @@ async function createNote(parentNoteId, title, content = "", extraOptions = {})
noteId: note.noteId,
type: attr.type,
name: attr.name,
value: attr.value
value: attr.value,
isInheritable: !!attr.isInheritable
});
}