Page MenuHomePhabricator

D3356.id10118.diff
No OneTemporary

D3356.id10118.diff

diff --git a/web/chat/message-action-buttons.js b/web/chat/message-action-buttons.js
--- a/web/chat/message-action-buttons.js
+++ b/web/chat/message-action-buttons.js
@@ -21,6 +21,7 @@
MessagePositionInfo,
OnMessagePositionWithContainerInfo,
} from './position-types';
+import { type PositionInfo } from './position-types';
import { tooltipPositions, type TooltipPosition } from './tooltip-utils';
import {
TooltipMenu,
@@ -70,25 +71,7 @@
return;
}
const rect = event.currentTarget.getBoundingClientRect();
- const { top, bottom, left, right, width, height } = rect;
-
- const iconPosition: ItemAndContainerPositionInfo = {
- containerPosition,
- itemPosition: {
- top:
- top -
- containerPosition.top +
- messageActionIconExcessVerticalWhitespace,
- bottom:
- bottom -
- containerPosition.top -
- messageActionIconExcessVerticalWhitespace,
- left: left - containerPosition.left,
- right: right - containerPosition.left,
- width,
- height: height - messageActionIconExcessVerticalWhitespace * 2,
- },
- };
+ const iconPosition = getIconPosition(rect, containerPosition);
setPointingTo(iconPosition);
},
[containerPosition, tooltipVisible],
@@ -255,4 +238,26 @@
return { className };
}
+function getIconPosition(
+ rect: ClientRect,
+ containerPosition: PositionInfo,
+): ItemAndContainerPositionInfo {
+ const { top, bottom, left, right, width, height } = rect;
+ return {
+ containerPosition,
+ itemPosition: {
+ top:
+ top - containerPosition.top + messageActionIconExcessVerticalWhitespace,
+ bottom:
+ bottom -
+ containerPosition.top -
+ messageActionIconExcessVerticalWhitespace,
+ left: left - containerPosition.left,
+ right: right - containerPosition.left,
+ width,
+ height: height - messageActionIconExcessVerticalWhitespace * 2,
+ },
+ };
+}
+
export default MessageActionButtons;

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 1, 4:44 PM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2605607
Default Alt Text
D3356.id10118.diff (2 KB)

Event Timeline