diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/ComparisonBox.tsx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx index eaf7419fc..fa0ab61bc 100644 --- a/src/client/views/nodes/ComparisonBox.tsx +++ b/src/client/views/nodes/ComparisonBox.tsx @@ -16,6 +16,7 @@ import { DocumentView } from './DocumentView'; import { FieldView, FieldViewProps } from './FieldView'; import { PinProps, PresBox } from './trails'; import { IntegerType } from 'mongodb'; +import { FormattedTextBox } from './formattedText/FormattedTextBox'; @observer export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>() implements ViewBoxInterface { @@ -160,14 +161,9 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>() remDoc2 = (doc: Doc | Doc[]) => (doc instanceof Doc ? [doc] : doc).reduce((res, doc) => res && this.remDoc(doc, this.fieldKey + '_2'), true); _closeRef = React.createRef<HTMLDivElement>(); - cycleAlternateText = () => { + flipFlashcard = () => { const usePath = this.layoutDoc[`_${this._props.fieldKey}_usePath`]; this.layoutDoc[`_${this._props.fieldKey}_usePath`] = usePath === undefined ? 'alternate' : undefined; - //: usePath === 'alternate' ? 'alternate:hover' : undefined; - //usePath === undefined ? 'alternate' : - //undefined; - //: usePath === 'alternate' ? 'alternate:hover' : undefined; - // console.log('CYCLE' + this.layoutDoc[`_${this._props.fieldKey}_usePath`]); }; @computed get overlayAlternateIcon() { @@ -177,17 +173,13 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>() className="formattedTextBox-alternateButton" onPointerDown={e => setupMoveUpEvents(e.target, e, returnFalse, emptyFunction, e => { - //side = side === 1 ? 0 : 1; - this.cycleAlternateText(); - console.log('HEREEEEE'); + this.flipFlashcard(); }) } style={{ //display: this._props.isContentActive() && !SnappingManager.IsDragging ? 'flex' : 'none', background: usepath === 'alternate' ? 'white' : 'black', - //usePath === undefined ? 'white' : usePath === 'alternate' ? 'black' : 'gray', color: usepath === 'alternate' ? 'black' : 'white', - //usePath === undefined ? 'black' : 'white', }}> <FontAwesomeIcon icon="turn-up" size="sm" /> </div> @@ -245,7 +237,10 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>() if (this.Document._layout_isFlashcard) { const side = this.layoutDoc[`_${this._props.fieldKey}_usePath`] === 'alternate' ? 1 : 0; - console.log('SIDEEEE' + side); + + if (!this.dataDoc[this.fieldKey + '_0']) this.dataDoc[this.fieldKey + '_0'] = DocUtils.copyDragFactory(Doc.UserDoc().emptyNote as Doc); + if (!this.dataDoc[this.fieldKey + '_1']) this.dataDoc[this.fieldKey + '_1'] = DocUtils.copyDragFactory(Doc.UserDoc().emptyNote as Doc); + return ( <div className={`comparisonBox${this._props.isContentActive() ? '-interactive' : ''}` /* change className to easily disable/enable pointer events in CSS */}> {displayBox(`${this.fieldKey}_${side}`, side, this._props.PanelWidth() - 3)} |