mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge branch 'stable'
This commit is contained in:
commit
427a266c57
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"version": "0.33.4",
|
"version": "0.33.5",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -7,8 +7,11 @@ const $custom = $("#confirm-dialog-custom");
|
|||||||
const DELETE_NOTE_BUTTON_ID = "confirm-dialog-delete-note";
|
const DELETE_NOTE_BUTTON_ID = "confirm-dialog-delete-note";
|
||||||
|
|
||||||
let resolve;
|
let resolve;
|
||||||
|
let $originallyFocused; // element focused before the dialog was opened so we can return to it afterwards
|
||||||
|
|
||||||
function confirm(message) {
|
function confirm(message) {
|
||||||
|
$originallyFocused = $(':focus');
|
||||||
|
|
||||||
$custom.hide();
|
$custom.hide();
|
||||||
|
|
||||||
glob.activeDialog = $dialog;
|
glob.activeDialog = $dialog;
|
||||||
@ -55,6 +58,11 @@ $dialog.on("hidden.bs.modal", () => {
|
|||||||
if (resolve) {
|
if (resolve) {
|
||||||
resolve(false);
|
resolve(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($originallyFocused) {
|
||||||
|
$originallyFocused.focus();
|
||||||
|
$originallyFocused = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function doResolve(ret) {
|
function doResolve(ret) {
|
||||||
|
@ -5,8 +5,11 @@ const $infoContent = $("#info-dialog-content");
|
|||||||
const $okButton = $("#info-dialog-ok-button");
|
const $okButton = $("#info-dialog-ok-button");
|
||||||
|
|
||||||
let resolve;
|
let resolve;
|
||||||
|
let $originallyFocused; // element focused before the dialog was opened so we can return to it afterwards
|
||||||
|
|
||||||
function info(message) {
|
function info(message) {
|
||||||
|
$originallyFocused = $(':focus');
|
||||||
|
|
||||||
utils.closeActiveDialog();
|
utils.closeActiveDialog();
|
||||||
|
|
||||||
glob.activeDialog = $dialog;
|
glob.activeDialog = $dialog;
|
||||||
@ -24,6 +27,11 @@ $dialog.on("hidden.bs.modal", () => {
|
|||||||
if (resolve) {
|
if (resolve) {
|
||||||
resolve();
|
resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($originallyFocused) {
|
||||||
|
$originallyFocused.focus();
|
||||||
|
$originallyFocused = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$okButton.click(() => $dialog.modal("hide"));
|
$okButton.click(() => $dialog.modal("hide"));
|
||||||
|
@ -6,6 +6,7 @@ import treeCache from "./tree_cache.js";
|
|||||||
import treeUtils from "./tree_utils.js";
|
import treeUtils from "./tree_utils.js";
|
||||||
import hoistedNoteService from "./hoisted_note.js";
|
import hoistedNoteService from "./hoisted_note.js";
|
||||||
import noteDetailService from "./note_detail.js";
|
import noteDetailService from "./note_detail.js";
|
||||||
|
import confirmDialog from "../dialogs/confirm.js";
|
||||||
|
|
||||||
async function moveBeforeNode(nodesToMove, beforeNode) {
|
async function moveBeforeNode(nodesToMove, beforeNode) {
|
||||||
nodesToMove = await filterRootNote(nodesToMove);
|
nodesToMove = await filterRootNote(nodesToMove);
|
||||||
@ -82,7 +83,7 @@ async function moveToNode(nodesToMove, toNode) {
|
|||||||
async function deleteNodes(nodes) {
|
async function deleteNodes(nodes) {
|
||||||
nodes = await filterRootNote(nodes);
|
nodes = await filterRootNote(nodes);
|
||||||
|
|
||||||
if (nodes.length === 0 || !confirm('Are you sure you want to delete select note(s) and all the sub-notes?')) {
|
if (nodes.length === 0 || !await confirmDialog.confirm('Are you sure you want to delete select note(s) and all the sub-notes?')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class NoteDetailText {
|
|||||||
}
|
}
|
||||||
|
|
||||||
focus() {
|
focus() {
|
||||||
this.$component.focus();
|
this.$editorEl.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
getEditor() {
|
getEditor() {
|
||||||
|
@ -635,6 +635,8 @@ async function createNote(node, parentNoteId, target, extraOptions = {}) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (target === 'after') {
|
if (target === 'after') {
|
||||||
|
console.log(`Appending node...`); // to debug duplicated nodes
|
||||||
|
|
||||||
await node.appendSibling(newNode).setActive(true);
|
await node.appendSibling(newNode).setActive(true);
|
||||||
}
|
}
|
||||||
else if (target === 'into') {
|
else if (target === 'into') {
|
||||||
@ -642,6 +644,8 @@ async function createNote(node, parentNoteId, target, extraOptions = {}) {
|
|||||||
await node.setExpanded();
|
await node.setExpanded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Adding node as child...`); // to debug duplicated nodes
|
||||||
|
|
||||||
node.addChildren(newNode);
|
node.addChildren(newNode);
|
||||||
|
|
||||||
await node.getLastChild().setActive(true);
|
await node.getLastChild().setActive(true);
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
<table class="note-detail-promoted-attributes"></table>
|
<table class="note-detail-promoted-attributes"></table>
|
||||||
|
|
||||||
<div class="note-detail-component-wrapper">
|
<div class="note-detail-component-wrapper">
|
||||||
<div class="note-detail-text note-detail-component" tabindex="10000">
|
<div class="note-detail-text note-detail-component">
|
||||||
<div class="note-detail-text-editor"></div>
|
<div class="note-detail-text-editor" tabindex="10000"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="note-detail-code note-detail-component"></div>
|
<div class="note-detail-code note-detail-component"></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user