Skip to content

Commit

Permalink
fix: zoom in/out click
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-season-bankup committed Dec 24, 2024
1 parent 0b25c0b commit e7a42b0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions web/app/components/workflow/operator/zoom-in-out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const ZoomInOut: FC = () => {
crossAxis: -2,
}}
>
<PortalToFollowElemTrigger asChild onClick={handleTrigger}>
<PortalToFollowElemTrigger asChild>
<div className={`
p-0.5 h-9 cursor-pointer text-[13px] text-gray-500 font-medium rounded-lg bg-white shadow-lg border-[0.5px] border-gray-100
${workflowReadOnly && '!cursor-not-allowed opacity-50'}
Expand All @@ -144,23 +144,29 @@ const ZoomInOut: FC = () => {
shortcuts={['ctrl', '-']}
>
<div
className='flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer hover:bg-black/5'
className={`flex items-center justify-center w-8 h-8 rounded-lg ${zoom <= 0.25 ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-black/5'}`}
onClick={(e) => {
if (zoom <= 0.25)
return

e.stopPropagation()
zoomOut()
}}
>
<RiZoomOutLine className='w-4 h-4' />
</div>
</TipPopup>
<div className='w-[34px]'>{parseFloat(`${zoom * 100}`).toFixed(0)}%</div>
<div onClick={handleTrigger} className='w-[34px] select-none'>{parseFloat(`${zoom * 100}`).toFixed(0)}%</div>
<TipPopup
title={t('workflow.operator.zoomIn')}
shortcuts={['ctrl', '+']}
>
<div
className='flex items-center justify-center w-8 h-8 rounded-lg cursor-pointer hover:bg-black/5'
className={`flex items-center justify-center w-8 h-8 rounded-lg ${zoom >= 2 ? 'cursor-not-allowed' : 'cursor-pointer hover:bg-black/5'}`}
onClick={(e) => {
if (zoom >= 2)
return

e.stopPropagation()
zoomIn()
}}
Expand Down

0 comments on commit e7a42b0

Please sign in to comment.