|
@@ -143,10 +143,8 @@ export default class PhotoView extends React.Component<
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- handleImageLoad = (imageParams, callback) => {
|
|
|
|
- this.setState({
|
|
|
|
- ...imageParams,
|
|
|
|
- }, callback);
|
|
|
|
|
|
+ handleImageLoad = imageParams => {
|
|
|
|
+ this.setState(imageParams);
|
|
};
|
|
};
|
|
|
|
|
|
handleStart = (clientX: number, clientY: number, touchLength: number = 0) => {
|
|
handleStart = (clientX: number, clientY: number, touchLength: number = 0) => {
|
|
@@ -423,14 +421,6 @@ export default class PhotoView extends React.Component<
|
|
this.handleUp(clientX, clientY);
|
|
this.handleUp(clientX, clientY);
|
|
};
|
|
};
|
|
|
|
|
|
- handleResize = () => {
|
|
|
|
- this.setState(initialState);
|
|
|
|
- const { onPhotoResize } = this.props;
|
|
|
|
- if (onPhotoResize) {
|
|
|
|
- onPhotoResize();
|
|
|
|
- }
|
|
|
|
- };
|
|
|
|
-
|
|
|
|
render() {
|
|
render() {
|
|
const {
|
|
const {
|
|
src,
|
|
src,
|
|
@@ -439,6 +429,8 @@ export default class PhotoView extends React.Component<
|
|
style,
|
|
style,
|
|
loadingElement,
|
|
loadingElement,
|
|
brokenElement,
|
|
brokenElement,
|
|
|
|
+ onPhotoResize,
|
|
|
|
+
|
|
showAnimateType,
|
|
showAnimateType,
|
|
originRect,
|
|
originRect,
|
|
onShowAnimateEnd,
|
|
onShowAnimateEnd,
|
|
@@ -485,7 +477,7 @@ export default class PhotoView extends React.Component<
|
|
onMouseDown={isMobile ? undefined : this.handleMouseDown}
|
|
onMouseDown={isMobile ? undefined : this.handleMouseDown}
|
|
onTouchStart={isMobile ? this.handleTouchStart : undefined}
|
|
onTouchStart={isMobile ? this.handleTouchStart : undefined}
|
|
onWheel={this.handleWheel}
|
|
onWheel={this.handleWheel}
|
|
- onPhotoResize={this.handleResize}
|
|
|
|
|
|
+ onPhotoResize={onPhotoResize}
|
|
style={{
|
|
style={{
|
|
WebkitTransform: transform,
|
|
WebkitTransform: transform,
|
|
transform,
|
|
transform,
|