This commit is contained in:
Magnus Åhall 2026-06-10 17:24:13 +02:00
parent 9ebda04428
commit 8a22cf569f
2 changed files with 4 additions and 30 deletions

View file

@ -87,25 +87,15 @@ export class App {
switch (event.key.toUpperCase()) { switch (event.key.toUpperCase()) {
case 'T': case 'T':
if (document.activeElement.id === 'tree-nodes') { if (document.activeElement.id === 'tree-nodes')
this.nodeUI.takeFocus() this.nodeUI.takeFocus()
} else { else
this.sidebar.focus() this.sidebar.focus()
}
break break
case 'F': case 'F':
_mbus.dispatch('op-search') _mbus.dispatch('op-search')
break break
/*
case 'C':
this.showPage('node')
break
case 'E':
this.showPage('keys')
break
*/
case 'M': case 'M':
globalThis._mbus.dispatch('MARKDOWN_TOGGLE') globalThis._mbus.dispatch('MARKDOWN_TOGGLE')
@ -115,25 +105,9 @@ export class App {
this.createNode() this.createNode()
break break
/*
case 'P':
this.showPage('node-properties')
break
*/
case 'S': case 'S':
this.nodeUI.saveNode() this.nodeUI.saveNode()
break break
/*
case 'U':
this.showPage('upload')
break
case 'F':
this.showPage('search')
break
*/
default: default:
handled = false handled = false

View file

@ -100,7 +100,7 @@ export class N2PageNodeUI extends CustomHTMLElement {
} else } else
this.elNodeContent.focus({ preventScroll: true }) this.elNodeContent.focus({ preventScroll: true })
}// }}} }// }}}
async renameNode() { async renameNode() {// {{{
const name = prompt('Change title', this.node.data.Name) const name = prompt('Change title', this.node.data.Name)
if (name === null) if (name === null)
return return
@ -123,7 +123,7 @@ export class N2PageNodeUI extends CustomHTMLElement {
console.error(err) console.error(err)
alert(err) alert(err)
} }
} }// }}}
async saveNode() {// {{{ async saveNode() {// {{{
if (!this.node.isModified()) if (!this.node.isModified())
return return