From: Alexander Ebert Date: Sat, 15 Aug 2020 18:04:03 +0000 (+0200) Subject: Close the notification drop-down after clicking a link X-Git-Tag: 5.3.0_Alpha_1~58 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a5ce0962d3e5042f40f653ecd5814fa222b913c3;p=GitHub%2FWoltLab%2FWCF.git 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. --- 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))); } });