Icons and keybindings for creating sub-documents and sibling documents

This commit is contained in:
Magnus Åhall 2026-06-12 08:47:24 +02:00
parent ffb7f4ac53
commit 9af733be64
4 changed files with 81 additions and 15 deletions

View file

@ -9,10 +9,11 @@ export class N2PageNodeUI extends CustomHTMLElement {
<style>
.el-functions {
display: grid;
grid-template-columns: 1fr repeat(3, min-content);
grid-template-columns: 1fr repeat(4, min-content);
grid-gap: 8px;
align-items: center;
justify-items: end;
cursor: pointer;
img {
height: 24px;
@ -29,6 +30,7 @@ export class N2PageNodeUI extends CustomHTMLElement {
<img data-el="icon-markdown">
<img data-el="icon-table-format" class="colorize" src="/images/${_VERSION}/icon_table.svg">
<img data-el="icon-history" class="colorize" src="/images/${_VERSION}/icon_history.svg">
<img data-el="icon-new-document" class="colorize" src="/images/${_VERSION}/icon_new_document.svg">
</div>
`
}// }}}
@ -83,6 +85,12 @@ export class N2PageNodeUI extends CustomHTMLElement {
})
this.elIconHistory.addEventListener('click', () => _mbus.dispatch('SHOW_PAGE', { page: 'history' }))
this.elIconSave.addEventListener('click', () => this.saveNode())
this.elIconNewDocument.addEventListener('click', event => {
if (event.shiftKey)
_app.createNode(this.node.ParentUUID)
else
_app.createNode()
})
this.showMarkdown(true)
}// }}}