From 5b7e01dff6597a25679638ee46083b7eb1feea61 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 18 May 2021 13:31:19 +0100 Subject: [PATCH] Rename tab event handlers to clarify target --- chrome/content/zotero/components/tabBar.jsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/components/tabBar.jsx b/chrome/content/zotero/components/tabBar.jsx index bda855cd86..12bfe76bbe 100644 --- a/chrome/content/zotero/components/tabBar.jsx +++ b/chrome/content/zotero/components/tabBar.jsx @@ -36,15 +36,15 @@ const TabBar = forwardRef(function (props, ref) { const mouseMoveWaitUntil = useRef(0); useEffect(() => { - window.addEventListener('mouseup', handleMouseUp); + window.addEventListener('mouseup', handleWindowMouseUp); return () => { - window.removeEventListener('mouseup', handleMouseUp); + window.removeEventListener('mouseup', handleWindowMouseUp); }; }, []); useImperativeHandle(ref, () => ({ setTabs })); - function handleMouseDown(event, id, index) { + function handleTabMouseDown(event, id, index) { if (event.target.closest('.tab-close')) { return; } @@ -55,7 +55,7 @@ const TabBar = forwardRef(function (props, ref) { event.stopPropagation(); } - function handleMouseMove(event) { + function handleTabBarMouseMove(event) { if (!draggingID.current || mouseMoveWaitUntil.current > Date.now()) { return; } @@ -91,7 +91,7 @@ const TabBar = forwardRef(function (props, ref) { mouseMoveWaitUntil.current = Date.now() + 100; } - function handleMouseUp(event) { + function handleWindowMouseUp(event) { draggingID.current = null; event.stopPropagation(); } @@ -109,7 +109,7 @@ const TabBar = forwardRef(function (props, ref) { /* Fix 'title' not working for HTML-in-XUL */ onMouseOver={() => window.Zotero_Tooltip.start(title)} onMouseOut={() => window.Zotero_Tooltip.stop()} - onMouseDown={(event) => handleMouseDown(event, id, index)} + onMouseDown={(event) => handleTabMouseDown(event, id, index)} >
{title}
+
{tabs.map((tab, index) => renderTab(tab, index))}
);