mirror of https://github.com/grafana/grafana.git
chore: move close icon last, set focus ref
This commit is contained in:
parent
12249d3211
commit
e01856dc06
|
@ -82,20 +82,9 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, isPinned, onCl
|
|||
</div>
|
||||
{(canEdit || canDelete || isPinned) && (
|
||||
<div className={styles.controls}>
|
||||
{isPinned && (
|
||||
<IconButton
|
||||
name={'times'}
|
||||
size={'sm'}
|
||||
onClick={(e) => {
|
||||
// Don't trigger onClick
|
||||
e.stopPropagation();
|
||||
onClose();
|
||||
}}
|
||||
tooltip={t('timeseries.annotation-tooltip2.tooltip-close', 'Close')}
|
||||
/>
|
||||
)}
|
||||
{canEdit && (
|
||||
<IconButton
|
||||
ref={focusRef}
|
||||
name={'pen'}
|
||||
size={'sm'}
|
||||
onClick={onEdit}
|
||||
|
@ -104,12 +93,26 @@ export const AnnotationTooltip2 = ({ annoVals, annoIdx, timeZone, isPinned, onCl
|
|||
)}
|
||||
{canDelete && (
|
||||
<IconButton
|
||||
ref={canEdit ? null : focusRef}
|
||||
name={'trash-alt'}
|
||||
size={'sm'}
|
||||
onClick={() => onAnnotationDelete(annoId)}
|
||||
tooltip={t('timeseries.annotation-tooltip2.tooltip-delete', 'Delete')}
|
||||
/>
|
||||
)}
|
||||
{isPinned && (
|
||||
<IconButton
|
||||
ref={canEdit || canDelete ? null : focusRef}
|
||||
name={'times'}
|
||||
size={'sm'}
|
||||
onClick={(e) => {
|
||||
// Don't trigger onClick
|
||||
e.stopPropagation();
|
||||
onClose();
|
||||
}}
|
||||
tooltip={t('timeseries.annotation-tooltip2.tooltip-close', 'Close')}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Stack>
|
||||
|
|
Loading…
Reference in New Issue