From dd6a138ea1efeb142d14bafb425117d98a205cd3 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Wed, 21 Feb 2024 10:10:16 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B06406=20-=20Restore=20news=20being=20open?= =?UTF-8?q?ed=20in=20a=20new=20tab=20by=20default=20to=20compensate=20iTop?= =?UTF-8?q?=20Hub=20lack=20of=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/components/newsroom-menu.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/components/newsroom-menu.js b/js/components/newsroom-menu.js index bf59af435..8168e7274 100644 --- a/js/components/newsroom-menu.js +++ b/js/components/newsroom-menu.js @@ -340,11 +340,9 @@ $(function() this._markOneMessageAsRead(idxProvider, msgId); // ... and open it as intended - if ($(oElem).attr('target') !== 'undefined') { - window.open($(oElem).attr('href'), $(oElem).attr('target')); - } else { - window.location.href = $(oElem).attr('href'); - } + // Note: Default behavior is to open the news on a new tab unless it is specified otherwise + const urlTarget = $(oElem).attr('target') !== 'undefined' ? $(oElem).attr('target') : '_blank'; + window.open($(oElem).attr('href'), urlTarget); // Finally refresh messages $(this.element).popover_menu("togglePopup");