mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Don't clear comment highlight when clicking on another link
When the user clicks anywhere on the page after following a permalink (e.g. from a notification), we would remove the comment highlight and the hash from the URL. Don't do it if the click is on another link: this avoids inserting extra history entries when clicking on several permalinks in a row. Change-Id: I5d77dae4608f74b2be09b9cb92e39a8662529a9f
This commit is contained in:
parent
364cf45156
commit
d27d9ab7b0
|
@ -548,7 +548,8 @@ function init( $container, state ) {
|
|||
} );
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
$( 'body' ).on( 'click', function ( e ) {
|
||||
if ( utils.isUnmodifiedLeftClick( e ) ) {
|
||||
if ( utils.isUnmodifiedLeftClick( e ) && !e.target.closest( 'a' ) ) {
|
||||
// Remove the highlight and the hash from the URL, unless clicking on another link
|
||||
highlighter.clearHighlightTargetComment( pageThreads );
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue