small fixes

This commit is contained in:
zadam 2020-03-31 21:47:15 +02:00
parent 4485650cbc
commit a73739d03e
5 changed files with 8 additions and 12 deletions

View File

@ -195,8 +195,6 @@ if (utils.isElectron()) {
items, items,
selectMenuItemHandler: ({command, spellingSuggestion}) => { selectMenuItemHandler: ({command, spellingSuggestion}) => {
if (command === 'replaceMisspelling') { if (command === 'replaceMisspelling') {
console.log("Replacing missspeling", spellingSuggestion);
webContents.insertText(spellingSuggestion); webContents.insertText(spellingSuggestion);
} }
} }

View File

@ -48,7 +48,9 @@ export async function showDialog(widget) {
$autoComplete.on('autocomplete:cursorchanged', function(event, suggestion, dataset) { $autoComplete.on('autocomplete:cursorchanged', function(event, suggestion, dataset) {
const noteId = treeService.getNoteIdFromNotePath(suggestion.path); const noteId = treeService.getNoteIdFromNotePath(suggestion.path);
if (noteId) {
setDefaultLinkTitle(noteId); setDefaultLinkTitle(noteId);
}
}); });
noteAutocompleteService.showRecentNotes($autoComplete); noteAutocompleteService.showRecentNotes($autoComplete);

View File

@ -40,7 +40,7 @@ export default class ChangePasswordOptions {
this.$form.on('submit', () => this.save()); this.$form.on('submit', () => this.save());
} }
optionsLoaded(options) {console.log(options); optionsLoaded(options) {
this.$username.text(options.username); this.$username.text(options.username);
} }

View File

@ -140,7 +140,7 @@ export default class BookTypeWidget extends TypeWidget {
}); });
this.$content.append($('<div class="note-book-auto-message"></div>') this.$content.append($('<div class="note-book-auto-message"></div>')
.append(`This note doesn't have any content so we display its children. Click `) .append(`This note doesn't have any content so we display its children. <br> Click `)
.append($addTextLink) .append($addTextLink)
.append(' if you want to add some text.')); .append(' if you want to add some text.'));
} }

View File

@ -7,6 +7,7 @@ import toastService from "../../services/toast.js";
import attributeAutocompleteService from "../../services/attribute_autocomplete.js"; import attributeAutocompleteService from "../../services/attribute_autocomplete.js";
import TypeWidget from "./type_widget.js"; import TypeWidget from "./type_widget.js";
import appContext from "../../services/app_context.js"; import appContext from "../../services/app_context.js";
import utils from "../../services/utils.js";
const uniDirectionalOverlays = [ const uniDirectionalOverlays = [
[ "Arrow", { [ "Arrow", {
@ -165,10 +166,6 @@ export default class RelationMapTypeWidget extends TypeWidget {
toastService.showMessage("Click on canvas to place new note"); toastService.showMessage("Click on canvas to place new note");
// reloading tree so that the new note appears there
// no need to wait for it to finish
treeService.reload();
this.clipboard = { noteId: note.noteId, title }; this.clipboard = { noteId: note.noteId, title };
}); });
@ -208,10 +205,9 @@ export default class RelationMapTypeWidget extends TypeWidget {
this.jsPlumbInstance.remove(this.noteIdToId(noteId)); this.jsPlumbInstance.remove(this.noteIdToId(noteId));
if (confirmDialog.isDeleteNoteChecked()) { if (confirmDialog.isDeleteNoteChecked()) {
await server.remove("notes/" + noteId); const taskId = utils.randomString(10);
// to force it to disappear from the tree await server.remove(`notes/${noteId}?taskId=${taskId}&last=true`);
treeService.reload();
} }
this.mapData.notes = this.mapData.notes.filter(note => note.noteId !== noteId); this.mapData.notes = this.mapData.notes.filter(note => note.noteId !== noteId);