diff options
author | bobzel <zzzman@gmail.com> | 2024-05-20 16:38:31 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-05-20 16:38:31 -0400 |
commit | 72a668d621346666c5e0bc35dd02e70f033ad8a8 (patch) | |
tree | 3d3f146a694a0702ea7ec1d33c0d5ae1fb77e703 | |
parent | 918eca2bcdfa19691cb8781d6dee7d23590fc8f8 (diff) |
restoring click to slide comparisonbox slider back and forth
-rw-r--r-- | src/client/views/nodes/ComparisonBox.tsx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/client/views/nodes/ComparisonBox.tsx b/src/client/views/nodes/ComparisonBox.tsx index 5dd3cc9b0..1bb6157b0 100644 --- a/src/client/views/nodes/ComparisonBox.tsx +++ b/src/client/views/nodes/ComparisonBox.tsx @@ -104,8 +104,8 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>() if (this._isAnyChildContentActive) return; this._animating = 'all 200ms'; // on click, animate slider movement to the targetWidth - // this.layoutDoc[this.clipWidthKey] = (targetWidth * 100) / this._props.PanelWidth(); - this.layoutDoc[this.clipHeightKey] = (targetWidth * 100) / this._props.PanelHeight(); + this.layoutDoc[this.clipWidthKey] = (targetWidth * 100) / this._props.PanelWidth(); + // this.layoutDoc[this.clipHeightKey] = (targetWidth * 100) / this._props.PanelHeight(); setTimeout( action(() => { @@ -298,6 +298,8 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>() console.error('GPT call failed'); } }; + layoutWidth = () => NumCast(this.layoutDoc.width, 200); + layoutHeight = () => NumCast(this.layoutDoc.height, 200); render() { const clearButton = (which: string) => ( @@ -329,8 +331,8 @@ export class ComparisonBox extends ViewBoxAnnotatableComponent<FieldViewProps>() containerViewPath={this.DocumentView?.().docViewPath} moveDocument={whichSlot.endsWith('1') ? this.moveDoc1 : this.moveDoc2} removeDocument={whichSlot.endsWith('1') ? this.remDoc1 : this.remDoc2} - NativeWidth={() => NumCast(this.layoutDoc.width, 200)} - NativeHeight={(): number => NumCast(this.layoutDoc.height, 200)} + NativeWidth={this.layoutWidth} + NativeHeight={this.layoutHeight} isContentActive={emptyFunction} isDocumentActive={returnFalse} whenChildContentsActiveChanged={this.whenChildContentsActiveChanged} |