aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ComparisonBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-10-10 15:54:13 -0400
committerbobzel <zzzman@gmail.com>2024-10-10 15:54:13 -0400
commite329ac0aea297e63401c7853fbf2d9d6b280cc2d (patch)
tree746a6091e9986c79f65bb65a8c010cff06ed1e2f /src/client/views/nodes/ComparisonBox.tsx
parenteded7f5aa62a2f0e19d5887a91ebc76163bdb996 (diff)
change the default flashcard to have a thin border and have text fill the card and be vertically and horizontally centered.
Diffstat (limited to 'src/client/views/nodes/ComparisonBox.tsx')
-rw-r--r--src/client/views/nodes/ComparisonBox.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx
index 12081ff87..9852228fa 100644
--- a/src/client/views/nodes/ComparisonBox.tsx
+++ b/src/client/views/nodes/ComparisonBox.tsx
@@ -121,7 +121,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
</div>
</Tooltip>
)}
- {DocCast(this.Document.embedContainer)?.type_collection === CollectionViewType.Carousel ? null : (
+ {DocCast(this.Document.embedContainer)?.type_collection !== CollectionViewType.Freeform ? null : (
<>
<Tooltip title={<div>Create a flashcard pile</div>}>
<div className="comparisonBox-button" onPointerDown={() => this.createFlashcardPile([this.Document], false)}>
@@ -411,6 +411,8 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
_height: NumCast(this.layoutDoc['_' + this._props.fieldKey + '_width'], 200) + 50,
_layout_fitWidth: false,
_layout_autoHeight: true,
+ _xMargin: 5,
+ _yMargin: 5,
});
newCol.x = this.layoutDoc.x;
newCol.y = NumCast(this.layoutDoc.y) + 50;
@@ -727,13 +729,13 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>()
// add text box to each side when comparison box is first created
if (!this.dataDoc[this.fieldKey + '_0'] && !this._isEmpty) {
const dataSplit = StrCast(this.dataDoc.data).includes('Keyword: ') ? StrCast(this.dataDoc.data).split('Keyword: ') : StrCast(this.dataDoc.data).split('Answer: ');
- const newDoc = Docs.Create.TextDocument(dataSplit[1], { _layout_autoHeight: true });
+ const newDoc = Docs.Create.TextDocument(dataSplit[1], { title: 'answer', _layout_autoHeight: true, _layout_centered: true, text_align: 'center', _layout_fitWidth: true });
this.addDoc(newDoc, this.fieldKey + '_0');
}
if (!this.dataDoc[this.fieldKey + '_1'] && !this._isEmpty) {
const dataSplit = StrCast(this.dataDoc.data).includes('Keyword: ') ? StrCast(this.dataDoc.data).split('Keyword: ') : StrCast(this.dataDoc.data).split('Answer: ');
- const newDoc = Docs.Create.TextDocument(dataSplit[0], { _layout_autoHeight: true });
+ const newDoc = Docs.Create.TextDocument(dataSplit[0], { title: 'question', _layout_autoHeight: true, _layout_centered: true, text_align: 'center', _layout_fitWidth: true });
this.addDoc(newDoc, this.fieldKey + '_1');
}