From 4b231bbaf21939144ed8639d35f022834a406e59 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 17 Oct 2024 22:02:19 -0400 Subject: changed layout_isFlashcard to layout_flashcardType with value of 'flashcard' to make it easy to search for flashcards. made carousel views able to focus() on a Doc. added ability for carousel and card views to have anchors so they can be pinned and linked. fixed pinning collections to save filters --- src/client/views/PinFuncs.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/client/views/PinFuncs.ts') diff --git a/src/client/views/PinFuncs.ts b/src/client/views/PinFuncs.ts index 430455644..5b57cd624 100644 --- a/src/client/views/PinFuncs.ts +++ b/src/client/views/PinFuncs.ts @@ -39,9 +39,14 @@ export interface PinProps { pinData?: pinDataTypes; } -/// copies values from the targetDoc (which is the prototype of the pinDoc) to -/// reserved fields on the pinDoc so that those values can be restored to the -/// target doc when navigating to it. +/** + * copies values from the targetDoc (which is the prototype of the pinDoc) to + * reserved fields on the pinDoc so that those values can be restored to the + * target doc when navigating to it. + * @param pinDoc Doc that will store pinned metadata + * @param pinProps description of props to pin + * @param targetDoc Doc that is being pinned + */ export function PinDocView(pinDocIn: Doc, pinProps: PinProps, targetDoc: Doc) { const pinDoc = pinDocIn; pinDoc.presentation = true; @@ -114,7 +119,7 @@ export function PinDocView(pinDocIn: Doc, pinProps: PinProps, targetDoc: Doc) { ) ); if (pinProps.pinData.type_collection) pinDoc.config_viewType = targetDoc._type_collection; - if (pinProps.pinData.filters) pinDoc.config_docFilters = ObjectField.MakeCopy(targetDoc.childFilters as ObjectField); + if (pinProps.pinData.filters) pinDoc.config_docFilters = ObjectField.MakeCopy(targetDoc.childFilters as ObjectField) ?? new List(); if (pinProps.pinData.pivot) pinDoc.config_pivotField = targetDoc._pivotField; if (pinProps.pinData.pannable) { pinDoc.config_panX = NumCast(targetDoc._freeform_panX); -- cgit v1.2.3-70-g09d2