Quit on empty panel click
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
							parent
							
								
									3e408b3fcd
								
							
						
					
					
						commit
						7cd8f1135b
					
				|  | @ -123,19 +123,25 @@ export default class ImageView extends React.Component { | |||
|         }); | ||||
|     }; | ||||
| 
 | ||||
|     onRotateCounterClockwiseClick = () => { | ||||
|     onRotateCounterClockwiseClick = (ev) => { | ||||
|         ev.preventDefault(); | ||||
|         ev.stopPropagation(); | ||||
|         const cur = this.state.rotation; | ||||
|         const rotationDegrees = (cur - 90) % 360; | ||||
|         this.setState({ rotation: rotationDegrees }); | ||||
|     }; | ||||
| 
 | ||||
|     onRotateClockwiseClick = () => { | ||||
|     onRotateClockwiseClick = (ev) => { | ||||
|         ev.preventDefault(); | ||||
|         ev.stopPropagation(); | ||||
|         const cur = this.state.rotation; | ||||
|         const rotationDegrees = (cur + 90) % 360; | ||||
|         this.setState({ rotation: rotationDegrees }); | ||||
|     }; | ||||
| 
 | ||||
|     onZoomInClick = () => { | ||||
|     onZoomInClick = (ev) => { | ||||
|         ev.preventDefault(); | ||||
|         ev.stopPropagation(); | ||||
|         if (this.state.zoom >= this.maxZoom) { | ||||
|             this.setState({zoom: this.maxZoom}); | ||||
|             return; | ||||
|  | @ -146,7 +152,9 @@ export default class ImageView extends React.Component { | |||
|         }); | ||||
|     }; | ||||
| 
 | ||||
|     onZoomOutClick = () => { | ||||
|     onZoomOutClick = (ev) => { | ||||
|         ev.preventDefault(); | ||||
|         ev.stopPropagation(); | ||||
|         if (this.state.zoom <= this.minZoom) { | ||||
|             this.setState({ | ||||
|                 zoom: this.minZoom, | ||||
|  | @ -160,6 +168,10 @@ export default class ImageView extends React.Component { | |||
|         }); | ||||
|     } | ||||
| 
 | ||||
|     onPanelClick = (ev) => { | ||||
|         this.props.onFinished(); | ||||
|     } | ||||
| 
 | ||||
|     onStartMoving = ev => { | ||||
|         ev.stopPropagation(); | ||||
|         ev.preventDefault(); | ||||
|  | @ -235,10 +247,7 @@ export default class ImageView extends React.Component { | |||
|                 ref={ref => this.focusLock = ref} | ||||
|             > | ||||
|                 <div className="mx_ImageView_content"> | ||||
|                     <div className="mx_ImageView_panel"> | ||||
|                         <div className="mx_ImageView_label"> | ||||
|                             { metadata } | ||||
|                         </div> | ||||
|                     <div className="mx_ImageView_panel" onClick={this.onPanelClick}> | ||||
|                         <div className="mx_ImageView_toolbar"> | ||||
|                             <div className="mx_ImageView_toolbar_buttons"> | ||||
|                                  | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Šimon Brandner
						Šimon Brandner