From e329ac0aea297e63401c7853fbf2d9d6b280cc2d Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 10 Oct 2024 15:54:13 -0400 Subject: change the default flashcard to have a thin border and have text fill the card and be vertically and horizontally centered. --- src/client/views/nodes/ComparisonBox.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/client/views/nodes/ComparisonBox.tsx') 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() )} - {DocCast(this.Document.embedContainer)?.type_collection === CollectionViewType.Carousel ? null : ( + {DocCast(this.Document.embedContainer)?.type_collection !== CollectionViewType.Freeform ? null : ( <> Create a flashcard pile}>
this.createFlashcardPile([this.Document], false)}> @@ -411,6 +411,8 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent() _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() // 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'); } -- cgit v1.2.3-70-g09d2