mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-12 00:48:50 +01:00
Test propagate contextmenu event
No long press yet
This commit is contained in:
parent
fe80215325
commit
42f9483491
1 changed files with 14 additions and 0 deletions
|
@ -286,6 +286,20 @@ function Notification({ notification, instance, reload, isStatic }) {
|
||||||
? `/${instance}/s/${actualStatusID}`
|
? `/${instance}/s/${actualStatusID}`
|
||||||
: `/s/${actualStatusID}`
|
: `/s/${actualStatusID}`
|
||||||
}
|
}
|
||||||
|
onContextMenu={(e) => {
|
||||||
|
const post = e.target.querySelector('.status');
|
||||||
|
if (post) {
|
||||||
|
// Fire a custom event to open the context menu
|
||||||
|
if (e.metaKey) return;
|
||||||
|
e.preventDefault();
|
||||||
|
post.dispatchEvent(
|
||||||
|
new MouseEvent('contextmenu', {
|
||||||
|
clientX: e.clientX,
|
||||||
|
clientY: e.clientY,
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{isStatic ? (
|
{isStatic ? (
|
||||||
<Status status={actualStatus} size="s" />
|
<Status status={actualStatus} size="s" />
|
||||||
|
|
Loading…
Reference in a new issue