diff --git a/static/js/app.mjs b/static/js/app.mjs index 0ce2cb0..112827e 100644 --- a/static/js/app.mjs +++ b/static/js/app.mjs @@ -87,25 +87,15 @@ export class App { switch (event.key.toUpperCase()) { case 'T': - if (document.activeElement.id === 'tree-nodes') { + if (document.activeElement.id === 'tree-nodes') this.nodeUI.takeFocus() - } else { + else this.sidebar.focus() - } break case 'F': _mbus.dispatch('op-search') break - /* - case 'C': - this.showPage('node') - break - - case 'E': - this.showPage('keys') - break - */ case 'M': globalThis._mbus.dispatch('MARKDOWN_TOGGLE') @@ -115,25 +105,9 @@ export class App { this.createNode() break - /* - case 'P': - this.showPage('node-properties') - break - - */ case 'S': this.nodeUI.saveNode() break - /* - - case 'U': - this.showPage('upload') - break - - case 'F': - this.showPage('search') - break - */ default: handled = false diff --git a/static/js/page_node.mjs b/static/js/page_node.mjs index 93f7c7a..963a72b 100644 --- a/static/js/page_node.mjs +++ b/static/js/page_node.mjs @@ -100,7 +100,7 @@ export class N2PageNodeUI extends CustomHTMLElement { } else this.elNodeContent.focus({ preventScroll: true }) }// }}} - async renameNode() { + async renameNode() {// {{{ const name = prompt('Change title', this.node.data.Name) if (name === null) return @@ -123,7 +123,7 @@ export class N2PageNodeUI extends CustomHTMLElement { console.error(err) alert(err) } - } + }// }}} async saveNode() {// {{{ if (!this.node.isModified()) return