mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
add tabindex to clickable elements (dismiss notification/s & go to profile link) #1781
This commit is contained in:
parent
14556db750
commit
422b92ba7a
@ -135,7 +135,7 @@ define(req, function(AppConfig, Default, Language) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
Messages.user_profile = 'Go to user profile';
|
||||
return Messages;
|
||||
|
||||
});
|
||||
|
||||
@ -81,8 +81,16 @@ define([
|
||||
Common.openURL(Hash.hashToHref('', 'calendar'));
|
||||
});
|
||||
} else if (userData && typeof(userData) === "object" && userData.profile) {
|
||||
avatar = h('span.cp-avatar');
|
||||
avatar = h('span.cp-avatar',{
|
||||
tabindex: 0,
|
||||
title: Messages.user_profile
|
||||
});
|
||||
Common.displayAvatar($(avatar), userData.avatar, userData.displayName || userData.name);
|
||||
$(avatar).keydown(function (e) {
|
||||
if (e.which === 13 || e.which === 32) {
|
||||
$(avatar).click();
|
||||
}
|
||||
});
|
||||
$(avatar).click(function (e) {
|
||||
e.stopPropagation();
|
||||
Common.openURL(Hash.hashToHref(userData.profile, 'profile'));
|
||||
@ -136,6 +144,7 @@ define([
|
||||
if (data.content.isDismissible) {
|
||||
var dismissIcon = h('span.fa.fa-times');
|
||||
var dismiss = h('div.cp-notification-dismiss', {
|
||||
tabindex: 0,
|
||||
title: Messages.notifications_dismiss,
|
||||
}, dismissIcon);
|
||||
$(dismiss).addClass("cp-clickable")
|
||||
|
||||
@ -74,7 +74,7 @@ define([
|
||||
h("h5.cp-app-notifications-panel-title",
|
||||
(Messages.notificationsPage || "Notifications") + " - " + categoryName),
|
||||
h("div.cp-app-notifications-panel-titlebar-buttons", [
|
||||
dismissAll = h("div.cp-app-notifications-dismissall.cp-clickable", { title: Messages.notifications_dismissAll || "Dismiss All" }, h("span.fa.fa-trash")),
|
||||
dismissAll = h("div.cp-app-notifications-dismissall.cp-clickable", { tabindex: 0, title: Messages.notifications_dismissAll || "Dismiss All" }, h("span.fa.fa-trash")),
|
||||
]),
|
||||
]),
|
||||
notifsList = h("div.cp-app-notifications-panel-list", [
|
||||
@ -154,6 +154,11 @@ define([
|
||||
}
|
||||
});
|
||||
|
||||
$(dismissAll).keydown(function (e) {
|
||||
if (e.keyCode === 13 || e.keyCode === 32) {
|
||||
$(dismissAll).click();
|
||||
}
|
||||
});
|
||||
$(dismissAll).click(function () {
|
||||
notifsData.forEach(function (data) {
|
||||
if (data.content.isDismissible) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user