mirror of
https://github.com/zadam/trilium.git
synced 2025-10-18 22:29:57 +02:00
feat(collection/presentation): support custom background color per slide
This commit is contained in:
parent
f377df32ed
commit
bbda8d3357
@ -174,7 +174,13 @@ function Presentation({ presentation, setApi } : { presentation: PresentationMod
|
||||
}
|
||||
|
||||
function Slide({ slide }: { slide: PresentationSlideBaseModel }) {
|
||||
return <section data-note-id={slide.noteId} dangerouslySetInnerHTML={slide.content} />;
|
||||
return (
|
||||
<section
|
||||
data-note-id={slide.noteId}
|
||||
data-background-color={slide.backgroundColor}
|
||||
dangerouslySetInnerHTML={slide.content}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function getNoteIdFromSlide(slide: HTMLElement | undefined) {
|
||||
|
@ -12,6 +12,7 @@ interface PresentationSlideModel extends PresentationSlideBaseModel {
|
||||
export interface PresentationSlideBaseModel {
|
||||
noteId: string;
|
||||
content: DangerouslySetInnerHTML;
|
||||
backgroundColor?: string;
|
||||
}
|
||||
|
||||
export interface PresentationModel {
|
||||
@ -40,7 +41,8 @@ async function buildVerticalSlides(parentSlideNote: FNote): Promise<undefined |
|
||||
async function buildSlideModel(note: FNote): Promise<PresentationSlideBaseModel> {
|
||||
return {
|
||||
noteId: note.noteId,
|
||||
content: await processContent(note)
|
||||
content: await processContent(note),
|
||||
backgroundColor: note.getLabelValue("slide:background") ?? undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ type Labels = {
|
||||
maxNestingDepth: number;
|
||||
includeArchived: boolean;
|
||||
"presentation:theme": string;
|
||||
"slide:background": string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user