move the unhoist button to the right

This commit is contained in:
zadam 2023-11-06 22:28:25 +01:00
parent 341480e7cf
commit 40fb6aa168

View File

@ -544,15 +544,6 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
const isHoistedNote = activeNoteContext && activeNoteContext.hoistedNoteId === note.noteId && note.noteId !== 'root'; const isHoistedNote = activeNoteContext && activeNoteContext.hoistedNoteId === note.noteId && note.noteId !== 'root';
if (isHoistedNote) {
const $unhoistButton = $('<span class="tree-item-button unhoist-button bx bx-door-open" title="Unhoist"></span>')
.on("click", cancelClickPropagation);
// unhoist button is prepended since compared to other buttons, this is not just convenience
// on the mobile interface - it's the only way to unhoist
$span.prepend($unhoistButton);
}
if (note.hasLabel('workspace') && !isHoistedNote) { if (note.hasLabel('workspace') && !isHoistedNote) {
const $enterWorkspaceButton = $('<span class="tree-item-button enter-workspace-button bx bx-door-open" title="Hoist this note (workspace)"></span>') const $enterWorkspaceButton = $('<span class="tree-item-button enter-workspace-button bx bx-door-open" title="Hoist this note (workspace)"></span>')
.on("click", cancelClickPropagation); .on("click", cancelClickPropagation);
@ -573,6 +564,13 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
$span.append($createChildNoteButton); $span.append($createChildNoteButton);
} }
if (isHoistedNote) {
const $unhoistButton = $('<span class="tree-item-button unhoist-button bx bx-door-open" title="Unhoist"></span>')
.on("click", cancelClickPropagation);
$span.append($unhoistButton);
}
}, },
// this is done to automatically lazy load all expanded notes after tree load // this is done to automatically lazy load all expanded notes after tree load
loadChildren: (event, data) => { loadChildren: (event, data) => {