reloading notes after script changes

This commit is contained in:
zadam
2019-10-20 12:29:34 +02:00
parent 78f5b7b288
commit 2305ad7405
21 changed files with 115 additions and 82 deletions

View File

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

View File

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

View File

@@ -23,7 +23,7 @@ export async function showDialog() {
// set default settings
$maxNotesInput.val(20);
const note = noteDetailService.getActiveNote();
const note = noteDetailService.getActiveTabNote();
if (!note) {
return;

View File

@@ -16,7 +16,7 @@ export function showDialog() {
$dialog.modal();
const activeNote = noteDetailService.getActiveNote();
const activeNote = noteDetailService.getActiveTabNote();
$noteId.text(activeNote.noteId);
$dateCreated.text(activeNote.dateCreated);

View File

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

View File

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