mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-18 12:41:54 +08:00
feat(view/calendar): improve display when creating empty note
This commit is contained in:
parent
e73ea36161
commit
169b2269b1
@ -290,7 +290,7 @@ class NoteContext extends Component implements EventListener<"entitiesReloaded">
|
|||||||
return (
|
return (
|
||||||
this.note &&
|
this.note &&
|
||||||
["default", "contextual-help"].includes(this.viewScope?.viewMode ?? "") &&
|
["default", "contextual-help"].includes(this.viewScope?.viewMode ?? "") &&
|
||||||
this.note.hasChildren() &&
|
(this.note.hasChildren() || this.note.getLabelValue("viewType") === "calendar") &&
|
||||||
["book", "text", "code"].includes(this.note.type) &&
|
["book", "text", "code"].includes(this.note.type) &&
|
||||||
this.note.mime !== "text/x-sqlite;schema=trilium" &&
|
this.note.mime !== "text/x-sqlite;schema=trilium" &&
|
||||||
!this.note.isLabelTruthy("hideChildrenOverview")
|
!this.note.isLabelTruthy("hideChildrenOverview")
|
||||||
|
@ -107,8 +107,7 @@ export default class NoteListWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
entitiesReloadedEvent(e: EventData<"entitiesReloaded">) {
|
entitiesReloadedEvent(e: EventData<"entitiesReloaded">) {
|
||||||
if (e.loadResults.getAttributeRows().find((attr) => attr.noteId === this.noteId && attr.name && ["viewType", "expanded", "pageSize"].includes(attr.name))) {
|
if (e.loadResults.getAttributeRows().find((attr) => attr.noteId === this.noteId && attr.name && ["viewType", "expanded", "pageSize"].includes(attr.name))) {
|
||||||
this.shownNoteId = null; // force render
|
this.refresh();
|
||||||
|
|
||||||
this.checkRenderStatus();
|
this.checkRenderStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import TypeWidget from "./type_widget.js";
|
import TypeWidget from "./type_widget.js";
|
||||||
import { t } from "../../services/i18n.js";
|
import { t } from "../../services/i18n.js";
|
||||||
import type FNote from "../../entities/fnote.js";
|
import type FNote from "../../entities/fnote.js";
|
||||||
|
import type { EventData } from "../../components/app_context.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="note-detail-book note-detail-printable">
|
<div class="note-detail-book note-detail-printable">
|
||||||
@ -35,6 +36,15 @@ export default class BookTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async doRefresh(note: FNote) {
|
async doRefresh(note: FNote) {
|
||||||
this.$helpNoChildren.toggle(!this.note?.hasChildren());
|
this.$helpNoChildren.toggle(
|
||||||
|
!this.note?.hasChildren()
|
||||||
|
&& this.note?.getAttributeValue("label", "viewType") !== "calendar");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||||
|
if (loadResults.getAttributeRows().find((attr) => attr.noteId === this.noteId && attr.name === "viewType")) {
|
||||||
|
this.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user