diff options
author | bobzel <zzzman@gmail.com> | 2022-12-07 18:40:51 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-12-07 18:40:51 -0500 |
commit | 7b8ca91984c41790de177e9d5275a230520cabc0 (patch) | |
tree | 7e137779a665da640c117943029fef16e2ba0e0f /src/client/views/nodes/ImageBox.tsx | |
parent | 6ffb3b6879fbe8e12b79eb00a316b08bf1993149 (diff) |
stopped update _cache in ProxyField because it invalidates too much stuff during rendering. moved some setContentViews() to constructors for efficiency
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index 19f5e9e29..ac953d13b 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -56,6 +56,11 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp @observable _curSuffix = ''; @observable _uploadIcon = uploadIcons.idle; + constructor(props: any) { + super(props); + this.props.setContentView?.(this); + } + protected createDropTarget = (ele: HTMLDivElement) => { this._dropDisposer?.(); ele && (this._dropDisposer = DragManager.MakeDropTarget(ele, this.drop.bind(this), this.props.Document)); @@ -94,7 +99,6 @@ export class ImageBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp }; componentDidMount() { - this.props.setContentView?.(this); // bcz: do not remove this. without it, stepping into an image in the lightbox causes an infinite loop.... this._disposers.sizer = reaction( () => ({ forceFull: this.props.renderDepth < 1 || this.layoutDoc._showFullRes, |