mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 19:36:12 +01:00
small fixes
This commit is contained in:
@@ -45,14 +45,14 @@ class AppContext extends Component {
|
||||
this.triggerEvent(eventName);
|
||||
});
|
||||
|
||||
this.children = [ rootWidget ];
|
||||
|
||||
this.executors = [
|
||||
this.tabManager,
|
||||
new DialogCommandExecutor(this),
|
||||
new Entrypoints(this)
|
||||
];
|
||||
|
||||
this.children = [ rootWidget, ...this.executors ];
|
||||
|
||||
if (utils.isElectron()) {
|
||||
this.children.push(new ZoomService(this));
|
||||
|
||||
@@ -75,7 +75,9 @@ class AppContext extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
console.error(`Unhandled command ${name}`);
|
||||
console.debug(`Unhandled command ${name}, converting to event.`);
|
||||
|
||||
await this.triggerEvent(name, data);
|
||||
}
|
||||
|
||||
getComponentByEl(el) {
|
||||
|
||||
@@ -60,18 +60,15 @@ async function pasteInto(parentNoteId) {
|
||||
}
|
||||
}
|
||||
|
||||
function copy(nodes) {
|
||||
clipboardBranchIds = nodes.map(node => node.data.branchId);
|
||||
function copy(branchIds) {
|
||||
clipboardBranchIds = branchIds;
|
||||
clipboardMode = 'copy';
|
||||
|
||||
toastService.showMessage("Note(s) have been copied into clipboard.");
|
||||
}
|
||||
|
||||
function cut(nodes) {
|
||||
clipboardBranchIds = nodes
|
||||
.filter(node => node.data.noteId !== hoistedNoteService.getHoistedNoteId())
|
||||
.filter(node => node.getParent().data.noteType !== 'search')
|
||||
.map(node => node.key);
|
||||
function cut(branchIds) {
|
||||
clipboardBranchIds = branchIds;
|
||||
|
||||
if (clipboardBranchIds.length > 0) {
|
||||
clipboardMode = 'cut';
|
||||
|
||||
@@ -621,22 +621,26 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
// after opening context menu, standard shortcuts don't work, but they are detected here
|
||||
// so we essentially takeover the standard handling with our implementation.
|
||||
"left": node => {
|
||||
node.navigate($.ui.keyCode.LEFT, true).then(this.clearSelectedNodes);
|
||||
node.navigate($.ui.keyCode.LEFT, true);
|
||||
this.clearSelectedNodes();
|
||||
|
||||
return false;
|
||||
},
|
||||
"right": node => {
|
||||
node.navigate($.ui.keyCode.RIGHT, true).then(this.clearSelectedNodes);
|
||||
node.navigate($.ui.keyCode.RIGHT, true);
|
||||
this.clearSelectedNodes();
|
||||
|
||||
return false;
|
||||
},
|
||||
"up": node => {
|
||||
node.navigate($.ui.keyCode.UP, true).then(this.clearSelectedNodes);
|
||||
node.navigate($.ui.keyCode.UP, true);
|
||||
this.clearSelectedNodes();
|
||||
|
||||
return false;
|
||||
},
|
||||
"down": node => {
|
||||
node.navigate($.ui.keyCode.DOWN, true).then(this.clearSelectedNodes);
|
||||
node.navigate($.ui.keyCode.DOWN, true);
|
||||
this.clearSelectedNodes();
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -647,6 +651,8 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
||||
hotKeyMap[shortcut] = node => this.triggerCommand(action.actionName, {node});
|
||||
}
|
||||
}
|
||||
|
||||
return hotKeyMap;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -167,7 +167,7 @@ export default class SearchBoxWidget extends BasicWidget {
|
||||
this.$searchInput.val("");
|
||||
}
|
||||
|
||||
searchInSubtreeCommand({noteId}) {
|
||||
searchInSubtreeEvent({noteId}) {
|
||||
noteId = noteId || appContext.tabManager.getActiveTabNoteId();
|
||||
|
||||
this.toggle(true);
|
||||
|
||||
Reference in New Issue
Block a user