diff options
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index db8bb2c6e..9838af4d0 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -76,7 +76,6 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { return FieldView.LayoutString(ImageBox, fieldKey); } _ffref = React.createRef<CollectionFreeFormView>(); - _oldWheel: HTMLElement | null = null; private _ignoreScroll = false; private _forcedScroll = false; private _dropDisposer?: DragManager.DragDropDisposer; @@ -536,24 +535,13 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { ); } - onPassiveWheel = (e: WheelEvent) => e.stopPropagation(); - - protected createDashEventsTarget = (ele: HTMLDivElement | null) => { - // this._dropDisposer?.(); - this._oldWheel?.removeEventListener('wheel', this.onPassiveWheel); - this._oldWheel = ele; - // prevent wheel events from passively propagating up through containers and prevents containers from preventDefault which would block scrolling - ele?.addEventListener('wheel', this.onPassiveWheel, { passive: false }); - }; - componentAIViewHistory = () => { return ( - <div className="imageBox-aiView-history" ref={this.createDashEventsTarget}> + <div className="imageBox-aiView-history"> <Button text="Clear History" type={Type.SEC} size={Size.XSMALL} /> {this._prevImgs.map(img => ( - <div> + <div key={img.pathname}> <img - key={img.pathname} className="imageBox-aiView-img" src={img.href} onClick={() => { @@ -573,18 +561,9 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { const field = this.dataDoc[this.fieldKey] instanceof ImageField ? Cast(this.dataDoc[this.fieldKey], ImageField, null) : new ImageField(String(this.dataDoc[this.fieldKey])); const showRegenerate = this.Document[DocData].ai; return ( - <div - className="imageBox-aiView" - ref={(ele: HTMLDivElement | null) => { - this._oldWheel?.removeEventListener('wheel', this.onPassiveWheel); - this._oldWheel = ele; - // prevent wheel events from passively propagating up through containers and prevents containers from preventDefault which would block scrolling - ele?.addEventListener('wheel', this.onPassiveWheel, { passive: false }); - }}> - Edit Image with AI + <div className="imageBox-aiView"> {showRegenerate && ( <div className="imageBox-aiView-regenerate-container"> - <text className="imageBox-aiView-subtitle">Regenerate AI Image</text> <div className="imageBox-aiView-regenerate"> <input className="imageBox-aiView-input" @@ -595,7 +574,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { placeholder="Prompt (Optional)" /> <Button - text="Regenerate" + text="Regenerate Image" type={Type.SEC} // style={{ alignSelf: 'flex-end' }} icon={this._regenerateLoading ? <ReactLoading type="spin" color={SettingsManager.userVariantColor} width={16} height={20} /> : <AiOutlineSend />} @@ -622,7 +601,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { </div> )} <div className="imageBox-aiView-options-container"> - {showRegenerate && <text className="imageBox-aiView-subtitle"> More Image Options </text>} + {showRegenerate && <text className="imageBox-aiView-subtitle"> More Options: </text>} <div className="imageBox-aiView-options"> <Button type={Type.TERT} |