moving components to its own directory

This commit is contained in:
zadam
2022-12-01 13:07:23 +01:00
parent 1a6c9be065
commit fc080f785b
65 changed files with 160 additions and 156 deletions

View File

@@ -0,0 +1,19 @@
import appContext from "./app_context.js";
import shortcutService from "../services/shortcuts.js";
import server from "../services/server.js";
import Component from "./component.js";
export default class ShortcutComponent extends Component {
constructor() {
server.get('keyboard-shortcuts-for-notes').then(shortcutAttributes => {
for (const attr in shortcutAttributes) {
bindNoteShortcutHandler(attr);
}
}
bindNoteShortcutHandler(attr) {
const handler = async () => appContext.tabManager.getActiveContext().setNote(attr.noteId);
shortcutService.bindGlobalShortcut(attr.value, handler, attr.attributeId);
}
}