mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
removing extra actions (add link, cloning) from jump to dialog
This commit is contained in:
parent
262b02c1b2
commit
e007ec5e21
@ -50,33 +50,7 @@ const jumpToNote = (function() {
|
|||||||
formEl.submit(() => {
|
formEl.submit(() => {
|
||||||
const action = dialogEl.find("button:focus").val();
|
const action = dialogEl.find("button:focus").val();
|
||||||
|
|
||||||
if (!action || action === 'jump') {
|
|
||||||
goToNote();
|
goToNote();
|
||||||
}
|
|
||||||
else if (action === 'add-link') {
|
|
||||||
const notePath = getSelectedNotePath();
|
|
||||||
|
|
||||||
if (notePath) {
|
|
||||||
dialogEl.dialog("close");
|
|
||||||
|
|
||||||
const noteId = treeUtils.getNoteIdFromNotePath(notePath);
|
|
||||||
|
|
||||||
link.addLinkToEditor(noteTree.getNoteTitle(noteId), '#' + notePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (action === 'add-current-as-child') {
|
|
||||||
treeChanges.cloneNoteTo(noteEditor.getCurrentNoteId(), getSelectedNoteId());
|
|
||||||
|
|
||||||
dialogEl.dialog("close");
|
|
||||||
}
|
|
||||||
else if (action === 'add-selected-as-child') {
|
|
||||||
treeChanges.cloneNoteTo(getSelectedNoteId(), noteEditor.getCurrentNoteId());
|
|
||||||
|
|
||||||
dialogEl.dialog("close");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
messaging.logError("Unknown action=" + action);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -157,17 +157,11 @@
|
|||||||
<div id="jump-to-note-dialog" title="Jump to note" style="display: none;">
|
<div id="jump-to-note-dialog" title="Jump to note" style="display: none;">
|
||||||
<form id="jump-to-note-form">
|
<form id="jump-to-note-form">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="jump-to-note-autocomplete">Jump to note</label>
|
<label for="jump-to-note-autocomplete">Note</label>
|
||||||
<input id="jump-to-note-autocomplete" style="width: 100%;">
|
<input id="jump-to-note-autocomplete" style="width: 100%;">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button name="action" value="jump" class="btn btn-sm">Jump</button>
|
<button name="action" value="jump" class="btn btn-sm">Jump</button>
|
||||||
|
|
||||||
<button name="action" value="add-link" class="btn btn-sm">Add link</button>
|
|
||||||
|
|
||||||
<button name="action" value="add-current-as-child" class="btn btn-sm">Add current as child</button>
|
|
||||||
|
|
||||||
<button name="action" value="add-selected-as-child" class="btn btn-sm">Add selected as child</button>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user