From 0072cb9324fd5bbd4bfaac48b549abe5b0d04bef Mon Sep 17 00:00:00 2001 From: daria Date: Wed, 13 Nov 2024 14:30:50 +0200 Subject: [PATCH] fix hover style for notifications #1525 remove `:has` selector --- customize.dist/src/less2/include/dropdown.less | 14 ++++++++------ www/common/sframe-common-mailbox.js | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/customize.dist/src/less2/include/dropdown.less b/customize.dist/src/less2/include/dropdown.less index baaed29a4..ef9cd374c 100644 --- a/customize.dist/src/less2/include/dropdown.less +++ b/customize.dist/src/less2/include/dropdown.less @@ -164,6 +164,14 @@ &:focus-visible { outline-color: @cp_dropdown-fg; } + &:hover { + background-color: @cp_dropdown-bg-hover; + } + } + li[role="menuitem"].cp-notification-avatar { + &:hover { + background-color: transparent; + } .cp-avatar:hover { background-color: @cp_dropdown-bg-hover; } @@ -173,12 +181,6 @@ } } - li[role="menuitem"]:not(:has(.cp-avatar)) { - &:hover { - background-color: @cp_dropdown-bg-hover; - } - } - &> span { box-sizing: border-box; height: 26px; diff --git a/www/common/sframe-common-mailbox.js b/www/common/sframe-common-mailbox.js index 857b46bbe..bf05bdd18 100644 --- a/www/common/sframe-common-mailbox.js +++ b/www/common/sframe-common-mailbox.js @@ -105,7 +105,9 @@ define([ h('p', data.content.msg.type + ' - ' +formatData(data)) ]) ]); - + if ($(notif).find('.cp-avatar').length) { + $(notif).addClass('cp-notification-avatar'); + } if (typeof(data.content.getFormatText) === "function") { $(notif).find('.cp-notification-content p').html(data.content.getFormatText()); if (data.content.autorefresh) {