aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-10-10 16:24:00 -0400
committerbobzel <zzzman@gmail.com>2024-10-10 16:24:00 -0400
commit386d640fe7fc4b443bc5f241f86e27424851dc4e (patch)
tree6a475c178ba36423ffa6c6d0d3cdbf2c6ec05896
parente329ac0aea297e63401c7853fbf2d9d6b280cc2d (diff)
adjusted placement of flaschard practice buttons to be closer to the bottom. Fixed being able to enter quiz mode for flaschards created as part of a stack by fixing embedContainer setting.
-rw-r--r--src/client/documents/Documents.ts15
-rw-r--r--src/client/views/collections/CollectionSubView.tsx1
-rw-r--r--src/client/views/collections/FlashcardPracticeUI.scss16
-rw-r--r--src/client/views/collections/FlashcardPracticeUI.tsx3
4 files changed, 16 insertions, 19 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index 358bc227e..d529de8e5 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -723,6 +723,9 @@ export namespace Docs {
updateCachedAcls(dataDoc);
updateCachedAcls(viewDoc);
+ if (data instanceof List) {
+ data.map(item => item instanceof Doc && Doc.SetContainer(item, viewDoc));
+ }
return viewDoc;
}
@@ -907,15 +910,13 @@ export namespace Docs {
}
export function CalendarDocument(options: DocumentOptions, documents: Array<Doc>) {
- const inst = InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), {
+ return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), {
_layout_nativeDimEditable: true,
_layout_reflowHorizontal: true,
_layout_reflowVertical: true,
...options,
_type_collection: CollectionViewType.Calendar,
});
- documents.forEach(d => Doc.SetContainer(d, inst));
- return inst;
}
// shouldn't ever need to create a KVP document-- instead set the LayoutTemplateString to be a KeyValueBox for the DocumentView (see addDocTab in TabDocView)
@@ -924,9 +925,7 @@ export namespace Docs {
// }
export function FreeformDocument(documents: Array<Doc>, options: DocumentOptions, id?: string) {
- const inst = InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Freeform }, id);
- documents.forEach(d => Doc.SetContainer(d, inst));
- return inst;
+ return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { ...options, _type_collection: CollectionViewType.Freeform }, id);
}
export function ConfigDocument(options: DocumentOptions, id?: string) {
@@ -1031,9 +1030,7 @@ export namespace Docs {
}
export function DockDocument(documents: Array<Doc>, config: string, options: DocumentOptions, id?: string) {
- const ret = InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { treeView_FreezeChildren: 'remove|add', ...options, type_collection: CollectionViewType.Docking, dockingConfig: config }, id);
- documents.map(c => Doc.SetContainer(c, ret));
- return ret;
+ return InstanceFromProto(Prototypes.get(DocumentType.COL), new List(documents), { treeView_FreezeChildren: 'remove|add', ...options, type_collection: CollectionViewType.Docking, dockingConfig: config }, id);
}
export function DelegateDocument(proto: Doc, options: DocumentOptions = {}) {
diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index c057d2402..f85b0b433 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -551,7 +551,6 @@ export function CollectionSubView<X>() {
filteredChildDocs={this.filteredChildDocs}
advance={answered}
curDoc={curDoc}
- practiceBtnOffset={this._sideBtnWidth * 4}
layoutDoc={this.layoutDoc}
uiBtnScaling={this.uiBtnScaling}
ScreenToLocalBoxXf={this.ScreenToLocalBoxXf}
diff --git a/src/client/views/collections/FlashcardPracticeUI.scss b/src/client/views/collections/FlashcardPracticeUI.scss
index 2f99500f8..4ed27793d 100644
--- a/src/client/views/collections/FlashcardPracticeUI.scss
+++ b/src/client/views/collections/FlashcardPracticeUI.scss
@@ -16,13 +16,15 @@
.FlashcardPracticeUI-practice {
position: absolute;
width: 100%;
- pointer-events: all;
-}
-.FlashcardPracticeUI-remove {
- left: 52%;
-}
-.FlashcardPracticeUI-check {
- right: 52%;
+ pointer-events: none;
+ .FlashcardPracticeUI-remove {
+ left: 52%;
+ pointer-events: all;
+ }
+ .FlashcardPracticeUI-check {
+ right: 52%;
+ pointer-events: all;
+ }
}
.FlashcardPracticeUI-menu {
position: absolute;
diff --git a/src/client/views/collections/FlashcardPracticeUI.tsx b/src/client/views/collections/FlashcardPracticeUI.tsx
index 0e9fe89c9..4e424f5cd 100644
--- a/src/client/views/collections/FlashcardPracticeUI.tsx
+++ b/src/client/views/collections/FlashcardPracticeUI.tsx
@@ -37,7 +37,6 @@ interface PracticeUIProps {
ScreenToLocalBoxXf: () => Transform;
docViewProps: () => DocumentViewProps;
setFilterFunc: (func?: (doc: Doc) => boolean) => void;
- practiceBtnOffset?: number;
}
@observer
export class FlashcardPracticeUI extends ObservableReactComponent<PracticeUIProps> {
@@ -105,7 +104,7 @@ export class FlashcardPracticeUI extends ObservableReactComponent<PracticeUIProp
};
return this.practiceMode == practiceMode.PRACTICE && this._props.curDoc() ? (
- <div className="FlashcardPracticeUI-practice" style={{ transform: `scale(${this._props.uiBtnScaling})`, bottom: `${this._props.practiceBtnOffset ?? this._props.sideBtnWidth}px`, height: `${this._props.sideBtnWidth}px` }}>
+ <div className="FlashcardPracticeUI-practice" style={{ transform: `scale(${this._props.uiBtnScaling})`, bottom: `${this._props.sideBtnWidth}px`, height: `${this._props.sideBtnWidth}px` }}>
<Tooltip title="Incorrect. View again later.">
<div key="remove" className="FlashcardPracticeUI-remove" onPointerDown={e => setupMoveUpEvents(this, e, returnFalse, emptyFunction, () => setPracticeVal(e, practiceVal.MISSED))}>
<FontAwesomeIcon icon="xmark" color="red" size="1x" />