aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/documents/Documents.ts1
-rw-r--r--src/client/util/CurrentUserUtils.ts2
-rw-r--r--src/client/views/SidebarAnnos.tsx1
-rw-r--r--src/client/views/nodes/ComparisonBox.tsx8
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx1
5 files changed, 8 insertions, 5 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index feaf41dfc..358bc227e 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -292,6 +292,7 @@ export class DocumentOptions {
_text_fontSize?: string;
_text_fontFamily?: string;
_text_fontWeight?: string;
+ text_align?: STRt = new StrInfo('horizontal text alignment default');
fontSize?: string;
_pivotField?: string; // field key used to determine headings for sections in stacking, masonry, pivot views
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index e7a4cbeeb..6b692a2aa 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -369,7 +369,7 @@ pie title Minerals in my tap water
creator:(opts:DocumentOptions)=> Doc // how to create the empty thing if it doesn't exist
}[] = [
{key: "Note", creator: opts => Docs.Create.TextDocument("", opts), opts: { _width: 200, _layout_autoHeight: true }},
- {key: "Flashcard", creator: opts => Docs.Create.ComparisonDocument("", opts), opts: { _layout_isFlashcard: true, _width: 300, _height: 300}},
+ {key: "Flashcard", creator: opts => Docs.Create.ComparisonDocument("", opts), opts: { _layout_isFlashcard: true, _layout_fitWidth: true, _width: 300, _height: 300}},
{key: "Image", creator: opts => Docs.Create.ImageDocument("", opts), opts: { _width: 400, _height:400 }},
{key: "Equation", creator: opts => Docs.Create.EquationDocument("",opts), opts: { _width: 300, _height: 35, }},
{key: "Noteboard", creator: opts => Docs.Create.NoteTakingDocument([], opts), opts: { _width: 250, _height: 200, _layout_fitWidth: true}},
diff --git a/src/client/views/SidebarAnnos.tsx b/src/client/views/SidebarAnnos.tsx
index dd60bfa65..1f3ad8444 100644
--- a/src/client/views/SidebarAnnos.tsx
+++ b/src/client/views/SidebarAnnos.tsx
@@ -232,7 +232,6 @@ export class SidebarAnnos extends ObservableReactComponent<FieldViewProps & Extr
<div style={{ width: '100%', height: `calc(100% - 38px)`, position: 'relative' }}>
<CollectionStackingView
- // eslint-disable-next-line react/jsx-props-no-spreading
{...this._props}
setContentViewBox={emptyFunction}
NativeWidth={returnZero}
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');
}
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index dac869f56..448dd5646 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1517,6 +1517,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
selectAll(this._editorView.state, tr => {
this._editorView!.dispatch(tr.replaceSelectionWith(state.schema.nodes.paragraph.create({ align: textAlign })));
});
+ this.tryUpdateDoc(true);
}
}
this._editorView.TextView = this;