From 27d99fff3f3df6f17d8e9c6197ba72662d51a2e3 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 24 Nov 2014 22:58:39 +0100 Subject: [PATCH] Going wild with pointer-events --- wcfsetup/install/files/js/WCF.User.js | 20 ++++++++++---------- wcfsetup/install/files/style/dropdown.less | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 11 deletions(-) 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; } } } -- 2.20.1