aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionCarouselView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-04-10 12:05:55 -0400
committerbobzel <zzzman@gmail.com>2025-04-10 12:05:55 -0400
commitb0bb28202fa77556768d1da93bf9ea879c6ba2e5 (patch)
tree85fbc30d8e82a87973d9aa2e8293d3012dc603f4 /src/client/views/collections/CollectionCarouselView.tsx
parent2d382a1dd28aa5aae22669988475e5721435b738 (diff)
performance fixes for text boxes to not call screenToLocal unnecessarily. simplifications to template data docs
Diffstat (limited to 'src/client/views/collections/CollectionCarouselView.tsx')
-rw-r--r--src/client/views/collections/CollectionCarouselView.tsx14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/client/views/collections/CollectionCarouselView.tsx b/src/client/views/collections/CollectionCarouselView.tsx
index c80ac23eb..2d3f8cb0e 100644
--- a/src/client/views/collections/CollectionCarouselView.tsx
+++ b/src/client/views/collections/CollectionCarouselView.tsx
@@ -16,7 +16,6 @@ import { FocusViewOptions } from '../nodes/FocusViewOptions';
import { FormattedTextBox } from '../nodes/formattedText/FormattedTextBox';
import './CollectionCarouselView.scss';
import { CollectionSubView, SubCollectionViewProps } from './CollectionSubView';
-import { DocData } from '../../../fields/DocSymbols';
@observer
export class CollectionCarouselView extends CollectionSubView() {
@@ -116,12 +115,14 @@ export class CollectionCarouselView extends CollectionSubView() {
? false
: undefined; // prettier-ignore
onPassiveWheel = (e: WheelEvent) => e.stopPropagation();
+
renderDoc = (doc: Doc, showCaptions: boolean, overlayFunc?: (r: DocumentView | null) => void) => {
return (
<DocumentView
{...this._props}
ref={overlayFunc}
Document={doc}
+ TemplateDataDocument={doc.isTemplateDoc || doc.isTemplateForField ? this._props.TemplateDataDocument : undefined}
NativeWidth={returnZero}
NativeHeight={returnZero}
fitWidth={this._props.childLayoutFitWidth}
@@ -137,7 +138,6 @@ export class CollectionCarouselView extends CollectionSubView() {
renderDepth={this._props.renderDepth + 1}
LayoutTemplate={this._props.childLayoutTemplate}
LayoutTemplateString={this._props.childLayoutString}
- TemplateDataDocument={doc[DocData]}
childFilters={this.childDocFilters}
focus={this.focus}
hideDecorations={BoolCast(this.layoutDoc.layout_hideDecorations)}
@@ -183,7 +183,15 @@ export class CollectionCarouselView extends CollectionSubView() {
}
@computed get content() {
- const captionProps = { ...this._props, NativeScaling: returnOne, PanelWidth: this.captionWidth, fieldKey: 'caption', setHeight: undefined, setContentView: undefined };
+ const captionProps = {
+ ...this._props, //
+ NativeScaling: returnOne,
+ PanelWidth: this.captionWidth,
+ fieldKey: 'caption',
+ setHeight: undefined,
+ setContentView: undefined,
+ noSidebar: true,
+ };
const carouselShowsCaptions = StrCast(this.layoutDoc._layout_showCaption);
return !this.curDoc() ? null : (
<>