aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/collections')
-rw-r--r--src/client/views/collections/CollectionCarouselView.tsx7
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;