Layout changes

This commit is contained in:
Magnus Åhall 2026-06-03 22:10:37 +02:00
parent d100b64108
commit d77b23b588
5 changed files with 131 additions and 51 deletions

View file

@ -237,7 +237,7 @@ class N2Crumbs extends CustomHTMLElement {
)
)
const start = new N2Crumb('Start', ROOT_NODE)
const start = new N2Crumb('', ROOT_NODE)
crumbs.push(start)
this.replaceChildren(...crumbs.reverse())
@ -255,8 +255,18 @@ class N2Crumb extends CustomHTMLElement {
}// }}}
constructor(label, uuid) {// {{{
super()
this.classList.add('crumb')
// The house makes it a bit more graphical than just a bunch of text.
if (uuid === ROOT_NODE) {
const start = document.createElement('div')
start.innerHTML = `<img src="/images/${_VERSION}/icon_home.svg">`
start.addEventListener('click', () => _mbus.dispatch("GO_TO_NODE", { nodeUUID: ROOT_NODE, dontPush: false, dontExpand: true }))
this.classList.add('home')
this.replaceChildren(start)
return
}
this.classList.add('crumb')
this.label = label
this.uuid = uuid

View file

@ -48,14 +48,14 @@ export class N2PageNodeUI extends CustomHTMLElement {
})
_mbus.subscribe('NODE_MODIFIED', () => {
document.querySelector('#crumbs .crumbs')?.classList.add('node-modified')
this.classList.add('node-modified')
this.elIconSave.src = `/images/${_VERSION}/icon_save.svg`
this.elIconSave.classList.add('colorize')
this.renderName()
})
_mbus.subscribe('NODE_UNMODIFIED', () => {
document.querySelector('#crumbs .crumbs')?.classList.remove('node-modified')
this.classList.remove('node-modified')
this.elIconSave.src = `/images/${_VERSION}/icon_save_disabled.svg`
this.elIconSave.classList.remove('colorize')
})