From 72a668d621346666c5e0bc35dd02e70f033ad8a8 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 20 May 2024 16:38:31 -0400
Subject: restoring click to slide comparisonbox slider back and forth

---
 src/client/views/nodes/ComparisonBox.tsx | 10 ++++++----
 1 file changed, 6 insertions(+), 4 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 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}
-- 
cgit v1.2.3-70-g09d2

