mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fixes
This commit is contained in:
parent
e06f3ef97e
commit
2c3f07521d
@ -98,7 +98,7 @@ class AppContext {
|
|||||||
this.trigger('treeCacheReloaded');
|
this.trigger('treeCacheReloaded');
|
||||||
}
|
}
|
||||||
|
|
||||||
async triggerCommand(name, data) {
|
async triggerCommand(name, data = {}) {
|
||||||
for (const executor of this.executors) {
|
for (const executor of this.executors) {
|
||||||
const fun = executor[name + 'Command'];
|
const fun = executor[name + 'Command'];
|
||||||
|
|
||||||
|
@ -35,9 +35,8 @@ async function setupActionsForElement(scope, $el, component) {
|
|||||||
|
|
||||||
getActionsForScope("window").then(actions => {
|
getActionsForScope("window").then(actions => {
|
||||||
for (const action of actions) {
|
for (const action of actions) {
|
||||||
for (const shortcut of action.effectiveShortcuts) {
|
for (const shortcut of action.effectiveShortcuts) {console.log(`Binding ${shortcut} for ${action.actionName}`);
|
||||||
// empty object param so that destructuring with optional params work
|
utils.bindGlobalShortcut(shortcut, () => appContext.triggerCommand(action.actionName));
|
||||||
utils.bindGlobalShortcut(shortcut, () => appContext.trigger(action.actionName, {}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -227,9 +227,11 @@ function focusSavedElement() {
|
|||||||
if ($lastFocusedElement.hasClass("ck")) {
|
if ($lastFocusedElement.hasClass("ck")) {
|
||||||
// must handle CKEditor separately because of this bug: https://github.com/ckeditor/ckeditor5/issues/607
|
// must handle CKEditor separately because of this bug: https://github.com/ckeditor/ckeditor5/issues/607
|
||||||
|
|
||||||
import("./note_detail.js").then(noteDetail => {
|
const editor = $lastFocusedElement
|
||||||
noteDetail.default.getActiveEditor().editing.view.focus();
|
.closest('.ck-editor__editable')
|
||||||
});
|
.prop('ckeditorInstance');
|
||||||
|
|
||||||
|
editor.editing.view.focus();
|
||||||
} else {
|
} else {
|
||||||
$lastFocusedElement.focus();
|
$lastFocusedElement.focus();
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ export default class Component {
|
|||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
}
|
}
|
||||||
|
|
||||||
async triggerCommand(name, data) {
|
async triggerCommand(name, data = {}) {
|
||||||
const fun = this[name + 'Command'];
|
const fun = this[name + 'Command'];
|
||||||
|
|
||||||
const called = await this.callMethod(fun, data);
|
const called = await this.callMethod(fun, data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user