From: Alexander Ebert Date: Mon, 24 Nov 2014 21:58:39 +0000 (+0100) Subject: Going wild with pointer-events X-Git-Tag: 2.1.0_Beta_1~169 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=27d99fff3f3df6f17d8e9c6197ba72662d51a2e3;p=GitHub%2FWoltLab%2FWCF.git Going wild with pointer-events --- diff --git a/wcfsetup/install/files/js/WCF.User.js b/wcfsetup/install/files/js/WCF.User.js index b02e8a5aa4..d409f71846 100644 --- a/wcfsetup/install/files/js/WCF.User.js +++ b/wcfsetup/install/files/js/WCF.User.js @@ -1352,18 +1352,18 @@ WCF.Notification.UserPanel = WCF.UserPanel.extend({ * @see WCF.UserPanel._after() */ _after: function(dropdownMenu) { - WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify()).children('li.jsNotificationItem').click(function(event) { - if (event.target.tagName !== 'A') { - var $item = $(this); - if ($item.data('link')) { + var $items = WCF.Dropdown.getDropdownMenu(this._container.wcfIdentify()).children('li.jsNotificationItem'); + + $items.each(function(index, item) { + var $item = $(item); + + $('').appendTo($item); + + $item.click(function(event) { + if (event.target.tagName !== 'A') { window.location = $item.data('link'); - - return false; } - - event.stopPropagation(); - return false; - } + }); }); }, diff --git a/wcfsetup/install/files/style/dropdown.less b/wcfsetup/install/files/style/dropdown.less index ea2e9dacaa..035237e725 100644 --- a/wcfsetup/install/files/style/dropdown.less +++ b/wcfsetup/install/files/style/dropdown.less @@ -247,6 +247,8 @@ } &.notificationItem { + position: relative; + &.groupedNotificationItem > span { > div:first-child { padding: 4px 2px 2px; @@ -258,8 +260,23 @@ } > span { - cursor: pointer; + pointer-events: none; + position: relative; white-space: normal; + z-index: 10; + + a { + pointer-events: all; + } + } + + > a.notificationItemLink { + bottom: 0; + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 1; } } }