Skip to content

Commit

Permalink
Do not zoom image on scroll if zoom buttons are not turned on (ToolJe…
Browse files Browse the repository at this point in the history
  • Loading branch information
sherfin94 authored Jun 13, 2022
1 parent 002ae8c commit ad3a9dd
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion frontend/src/Editor/Components/Image.jsx
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ export const Image = function Image({ component, height, properties, styles, fir
<center>
<div className="spinner-border " role="status"></div>
</center>
) : (
) : zoomButtons ? (
<>
<TransformWrapper>
{({ zoomIn, zoomOut }) => (
@@ -89,6 +89,22 @@ export const Image = function Image({ component, height, properties, styles, fir
)}
</TransformWrapper>
</>
) : (
<img
src={source}
className={`zoom-image-wrap ${borderType !== 'none' ? borderType : ''}`}
style={{
backgroundColor,
padding: Number.parseInt(padding),
objectFit: imageFit ? imageFit : 'contain',
cursor: hasOnClickEvent ? 'pointer' : 'inherit',
pointerEvents: 'auto',
}}
height={height}
onClick={() => fireEvent('onClick')}
alt={alternativeText}
width={width}
/>
)}
</LazyLoad>
)}

0 comments on commit ad3a9dd

Please sign in to comment.