From a5ce0962d3e5042f40f653ecd5814fa222b913c3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 15 Aug 2020 20:04:03 +0200 Subject: [PATCH] Close the notification drop-down after clicking a link This prevents the drop-down from staying open if the link is _effectively_ a no-op that does not cause a navigation, such as when the link target is the current page. --- wcfsetup/install/files/js/WCF.User.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index df99e45f7e..bbecb3611d 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -617,6 +617,16 @@ if (COMPILER_TARGET_DEFAULT) { } this.updateBadge(count); + }, + + _success: function(data) { + this._super(data); + + elBySelAll('.interactiveDropdownItemShadowLink', this._dropdown.getItemList()[0], (function (link) { + link.addEventListener('click', (function (event) { + this._dropdown.close(); + }).bind(this)); + }.bind(this))); } }); -- 2.20.1