mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
feat(book/table): hide no children warning
This commit is contained in:
parent
fcd71957ff
commit
5450bdeae9
@ -36,7 +36,21 @@ export default class BookTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async doRefresh(note: FNote) {
|
async doRefresh(note: FNote) {
|
||||||
this.$helpNoChildren.toggle(!this.note?.hasChildren() && this.note?.getAttributeValue("label", "viewType") !== "calendar");
|
this.$helpNoChildren.toggle(this.shouldDisplayNoChildrenWarning());
|
||||||
|
}
|
||||||
|
|
||||||
|
shouldDisplayNoChildrenWarning() {
|
||||||
|
if (this.note?.hasChildren()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (this.note?.getAttributeValue("label", "viewType")) {
|
||||||
|
case "calendar":
|
||||||
|
case "table":
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user