From c417100c39fa3092e466025add9efa2c0bcd8e8d Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Fri, 24 Nov 2023 00:45:47 +0100 Subject: [PATCH] Middle click on title to mark entry as read --- client/js/templates/Item.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/client/js/templates/Item.jsx b/client/js/templates/Item.jsx index b0e1db430e..d7fe457832 100644 --- a/client/js/templates/Item.jsx +++ b/client/js/templates/Item.jsx @@ -367,6 +367,15 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa [history, location, expanded, item.id] ); + const titleOnAuxClick = useCallback( + (event) => { + if (event.button === 1 && canWrite) { + selfoss.entriesPage.markEntryRead(item.id, true); + } + }, + [item.id] + ); + const starOnClick = useCallback( (event) => { event.preventDefault(); @@ -459,6 +468,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa aria-expanded={expanded} aria-current={selected} tabIndex="0" + onAuxClick={titleOnAuxClick} onKeyUp={handleKeyUp} dangerouslySetInnerHTML={titleHtml} />