diff options
| author | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-06-06 09:53:12 -0400 |
|---|---|---|
| committer | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-06-06 09:53:12 -0400 |
| commit | c76505f56a83625e3993427838aaee0c54c5fb81 (patch) | |
| tree | 99f498b643b9862e5d1ec34b75ffdaeeb0a52877 /src/client/views/collections/CollectionCarouselView.tsx | |
| parent | 585f03bf45df4ac7ed61d22c9dbe10d8e453199d (diff) | |
Fixes to chatcard and quizcard
Diffstat (limited to 'src/client/views/collections/CollectionCarouselView.tsx')
| -rw-r--r-- | src/client/views/collections/CollectionCarouselView.tsx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionCarouselView.tsx b/src/client/views/collections/CollectionCarouselView.tsx index 2893de762..53d14e6e0 100644 --- a/src/client/views/collections/CollectionCarouselView.tsx +++ b/src/client/views/collections/CollectionCarouselView.tsx @@ -35,6 +35,7 @@ export class CollectionCarouselView extends CollectionSubView() { private _dropDisposer?: DragManager.DragDropDisposer; @observable private _message = 'Drag a document'; get practiceField() { return this.fieldKey + "_practice"; } // prettier-ignore + get sideField() { return "_" + this.fieldKey + "_usePath"; } // prettier-ignore get starField() { return this.fieldKey + "_star"; } // prettier-ignore constructor(props: any) { @@ -131,9 +132,6 @@ export class CollectionCarouselView extends CollectionSubView() { curDoc.layout[this.practiceField] = val; this.advance(e); }; - clearContent = () => { - this.carouselItems?.map(doc => (doc.layout[this.practiceField] = undefined)); - }; captionStyleProvider = (doc: Doc | undefined, captionProps: Opt<FieldViewProps>, property: string): any => { // first look for properties on the document in the carousel, then fallback to properties on the container const childValue = doc?.['caption_' + property] ? this._props.styleProvider?.(doc, captionProps, property) : undefined; @@ -146,7 +144,8 @@ export class CollectionCarouselView extends CollectionSubView() { setFilterMode = (mode: cardMode) => { this.layoutDoc.filterOp = mode; if (mode == cardMode.STAR) this.move(1); - this.clearContent(); + if (mode == cardMode.QUIZ) this.carouselItems?.map(doc => (doc.layout[this.sideField] = undefined)); + this.carouselItems?.map(doc => (doc.layout[this.practiceField] = undefined)); }; specificMenu = (): void => { const cm = ContextMenu.Instance; |
