mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 07:38:53 +02:00
feat(popup_editor): support collections
This commit is contained in:
parent
59ce2072c5
commit
27738acefc
@ -230,7 +230,7 @@ export default class DesktopLayout {
|
|||||||
.child(new PromotedAttributesWidget())
|
.child(new PromotedAttributesWidget())
|
||||||
.child(new SqlTableSchemasWidget())
|
.child(new SqlTableSchemasWidget())
|
||||||
.child(new NoteDetailWidget())
|
.child(new NoteDetailWidget())
|
||||||
.child(new NoteListWidget())
|
.child(new NoteListWidget(false))
|
||||||
.child(new SearchResultWidget())
|
.child(new SearchResultWidget())
|
||||||
.child(new SqlResultWidget())
|
.child(new SqlResultWidget())
|
||||||
.child(new ScrollPaddingWidget())
|
.child(new ScrollPaddingWidget())
|
||||||
@ -268,7 +268,8 @@ export default class DesktopLayout {
|
|||||||
.child(new NoteTitleWidget()))
|
.child(new NoteTitleWidget()))
|
||||||
.child(new ClassicEditorToolbar())
|
.child(new ClassicEditorToolbar())
|
||||||
.child(new PromotedAttributesWidget())
|
.child(new PromotedAttributesWidget())
|
||||||
.child(new NoteDetailWidget()));
|
.child(new NoteDetailWidget())
|
||||||
|
.child(new NoteListWidget(true)));
|
||||||
|
|
||||||
applyModals(rootContainer);
|
applyModals(rootContainer);
|
||||||
return rootContainer;
|
return rootContainer;
|
||||||
|
@ -40,16 +40,32 @@ export default class NoteListWidget extends NoteContextAwareWidget {
|
|||||||
private shownNoteId?: string | null;
|
private shownNoteId?: string | null;
|
||||||
private viewMode?: ViewMode<any> | null;
|
private viewMode?: ViewMode<any> | null;
|
||||||
private attributeDetailWidget: AttributeDetailWidget;
|
private attributeDetailWidget: AttributeDetailWidget;
|
||||||
|
private displayOnlyCollections: boolean;
|
||||||
|
|
||||||
constructor() {
|
/**
|
||||||
|
* @param displayOnlyCollections if set to `true` then only collection-type views are displayed such as geo-map and the calendar. The original book types grid and list will be ignored.
|
||||||
|
*/
|
||||||
|
constructor(displayOnlyCollections: boolean) {
|
||||||
super();
|
super();
|
||||||
this.attributeDetailWidget = new AttributeDetailWidget()
|
this.attributeDetailWidget = new AttributeDetailWidget()
|
||||||
.contentSized()
|
.contentSized()
|
||||||
.setParent(this);
|
.setParent(this);
|
||||||
|
this.displayOnlyCollections = displayOnlyCollections;
|
||||||
}
|
}
|
||||||
|
|
||||||
isEnabled() {
|
isEnabled() {
|
||||||
return super.isEnabled() && this.noteContext?.hasNoteList();
|
if (!super.isEnabled()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.displayOnlyCollections) {
|
||||||
|
const viewType = this.note?.getLabelValue("viewType");
|
||||||
|
if (!viewType || ["grid", "list"].includes(viewType)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.noteContext?.hasNoteList();
|
||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user