Merge pull request #1674 from cryptpad/contact-request-notification-fixes

Notification fixes
This commit is contained in:
yflory 2024-12-12 14:00:57 +01:00 committed by GitHub
commit bebf4aa746
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 29 additions and 5 deletions

View File

@ -160,12 +160,12 @@
li[role="menuitem"] {
border-radius: @variables_radius;
white-space: nowrap;
&:hover {
background-color: @cp_dropdown-bg-hover !important;
}
&:focus-visible {
outline-color: @cp_dropdown-fg;
}
&:hover {
background-color: @cp_dropdown-bg-hover;
}
}
&> span {
box-sizing: border-box;

View File

@ -97,6 +97,26 @@
margin: 0;
}
}
.cp-dropdown-container .cp-dropdown-content {
li[role="menuitem"]{
.cp-notification-dismiss:hover {
border-radius: @variables_radius;
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;
}
.cp-notification-content:hover {
border-radius: @variables_radius;
background-color: @cp_dropdown-bg-hover;
}
}
}
}

View File

@ -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) {

View File

@ -1198,7 +1198,9 @@ MessengerUI, Messages, Pages, PadTypes) {
$('body').find('.cp-dropdown-content li').first().focus();
return $(el).find('.cp-notification-dismiss').click();
}
$(el).find('.cp-notification-content').click();
setTimeout(function () {
$(el).find('.cp-notification-content').click();
}, 0);
});
refresh();
},