From 32a742020243ffadfdae2cbc0a8b2853b0f06fc5 Mon Sep 17 00:00:00 2001 From: alyssaf16 Date: Sun, 10 Mar 2024 14:33:08 -0400 Subject: flashcard --- src/client/views/nodes/ComparisonBox.tsx | 12 +++++++++++- src/client/views/nodes/formattedText/FormattedTextBox.tsx | 4 ---- 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx index fa0ab61bc..86a9bcf63 100644 --- a/src/client/views/nodes/ComparisonBox.tsx +++ b/src/client/views/nodes/ComparisonBox.tsx @@ -37,6 +37,14 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent() get clipWidthKey() { return '_' + this._props.fieldKey + '_clipWidth'; } + + @computed get clipHeight() { + return NumCast(this.layoutDoc[this.clipHeightKey], 200); + } + get clipHeightKey() { + return '_' + this._props.fieldKey + '_clipHeight'; + } + componentDidMount() { this._props.setContentViewBox?.(this); } @@ -80,6 +88,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent() this._animating = 'all 200ms'; // on click, animate slider movement to the targetWidth this.layoutDoc[this.clipWidthKey] = (targetWidth * 100) / this._props.PanelWidth(); + setTimeout( action(() => (this._animating = '')), 200 @@ -201,6 +210,7 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent() const displayDoc = (which: string) => { const whichDoc = DocCast(this.dataDoc[which]); const targetDoc = DocCast(whichDoc?.annotationOn, whichDoc); + return targetDoc ? ( <> () moveDocument={which.endsWith('1') ? this.moveDoc1 : this.moveDoc2} removeDocument={which.endsWith('1') ? this.remDoc1 : this.remDoc2} NativeWidth={returnZero} - NativeHeight={returnZero} + NativeHeight={() => this.clipHeight} isContentActive={emptyFunction} isDocumentActive={returnFalse} whenChildContentsActiveChanged={this.whenChildContentsActiveChanged} diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 61d6094b9..4250b018e 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1949,10 +1949,6 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent