renamed currentNote to activeNote to be consistent with frontend API

This commit is contained in:
zadam
2019-03-14 20:21:27 +01:00
parent 0d0464549f
commit ef40c66344
22 changed files with 117 additions and 117 deletions

View File

@@ -27,7 +27,7 @@ function setLinkType(linkType) {
async function showDialog() {
glob.activeDialog = $dialog;
if (noteDetailService.getCurrentNoteType() === 'text') {
if (noteDetailService.getActiveNoteType() === 'text') {
$linkTypeHtml.prop('disabled', false);
setLinkType('html');
@@ -99,14 +99,14 @@ $form.submit(() => {
else if (linkType === 'selected-to-current') {
const prefix = $clonePrefix.val();
cloningService.cloneNoteTo(noteId, noteDetailService.getCurrentNoteId(), prefix);
cloningService.cloneNoteTo(noteId, noteDetailService.getActiveNoteId(), prefix);
$dialog.modal('hide');
}
else if (linkType === 'current-to-selected') {
const prefix = $clonePrefix.val();
cloningService.cloneNoteTo(noteDetailService.getCurrentNoteId(), noteId, prefix);
cloningService.cloneNoteTo(noteDetailService.getActiveNoteId(), noteId, prefix);
$dialog.modal('hide');
}

View File

@@ -90,7 +90,7 @@ function AttributesModel() {
}
this.loadAttributes = async function() {
const noteId = noteDetailService.getCurrentNoteId();
const noteId = noteDetailService.getActiveNoteId();
const attributes = await server.get('notes/' + noteId + '/attributes');
@@ -136,7 +136,7 @@ function AttributesModel() {
self.updateAttributePositions();
const noteId = noteDetailService.getCurrentNoteId();
const noteId = noteDetailService.getActiveNoteId();
const attributesToSave = self.ownedAttributes()
.map(attribute => attribute())

View File

@@ -13,13 +13,13 @@ function showDialog() {
$dialog.modal();
const currentNote = noteDetailService.getCurrentNote();
const activeNote = noteDetailService.getActiveNote();
$noteId.text(currentNote.noteId);
$utcDateCreated.text(currentNote.utcDateCreated);
$utcDateModified.text(currentNote.utcDateModified);
$type.text(currentNote.type);
$mime.text(currentNote.mime);
$noteId.text(activeNote.noteId);
$utcDateCreated.text(activeNote.utcDateCreated);
$utcDateModified.text(activeNote.utcDateModified);
$type.text(activeNote.type);
$mime.text(activeNote.mime);
}
$okButton.click(() => $dialog.modal('hide'));

View File

@@ -11,7 +11,7 @@ let revisionItems = [];
let note;
async function showCurrentNoteRevisions() {
await showNoteRevisionsDialog(noteDetailService.getCurrentNoteId());
await showNoteRevisionsDialog(noteDetailService.getActiveNoteId());
}
async function showNoteRevisionsDialog(noteId, noteRevisionId) {
@@ -22,7 +22,7 @@ async function showNoteRevisionsDialog(noteId, noteRevisionId) {
$list.empty();
$content.empty();
note = noteDetailService.getCurrentNote();
note = noteDetailService.getActiveNote();
revisionItems = await server.get('notes/' + noteId + '/revisions');
for (const item of revisionItems) {

View File

@@ -8,7 +8,7 @@ function showDialog() {
$dialog.modal();
const noteText = noteDetailService.getCurrentNote().noteContent.content;
const noteText = noteDetailService.getActiveNote().noteContent.content;
$noteSource.text(formatHtml(noteText));
}