mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
clean code
This commit is contained in:
parent
b52da4c664
commit
7f55741b1b
@ -88,15 +88,11 @@ define([
|
||||
role: 'button'
|
||||
});
|
||||
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) {
|
||||
const handler = function (e) {
|
||||
e.stopPropagation();
|
||||
Common.openURL(Hash.hashToHref(userData.profile, 'profile'));
|
||||
});
|
||||
};
|
||||
Util.onClickEnter($(avatar), handler, { space: true });
|
||||
} else if (userData && userData.supportTeam) {
|
||||
avatar = h('span.cp-avatar-image', h('img', { src:'/customize/CryptPad_logo.svg' }));
|
||||
}
|
||||
@ -128,7 +124,8 @@ define([
|
||||
$(notif).find('.cp-notification-content p').html(data.content.getFormatText());
|
||||
}, 60000);
|
||||
}
|
||||
$(notif).find('.cp-notification-content').attr('aria-label', data.content.getFormatText().replace(/<[^>]*>/g, '')); // removes html tags from the text
|
||||
const label = $(notif).find('.cp-notification-content p').text();
|
||||
$(notif).find('.cp-notification-content').attr('aria-label', label);
|
||||
}
|
||||
|
||||
$(notif).mouseenter((e) => {
|
||||
|
||||
@ -14,6 +14,7 @@ define([
|
||||
'/common/common-interface.js',
|
||||
'/common/common-ui-elements.js',
|
||||
'/common/notifications.js',
|
||||
'/common/common-util.js',
|
||||
|
||||
'css!/components/bootstrap/dist/css/bootstrap.min.css',
|
||||
'css!/components/components-font-awesome/css/font-awesome.min.css',
|
||||
@ -29,7 +30,8 @@ define([
|
||||
Messages,
|
||||
UI,
|
||||
UIElements,
|
||||
Notifications
|
||||
Notifications,
|
||||
Util,
|
||||
)
|
||||
{
|
||||
var APP = {};
|
||||
@ -160,19 +162,17 @@ define([
|
||||
$('.cp-app-notification-archived[data-hash="' + data.hash + '"]').css('display', 'flex');
|
||||
}
|
||||
});
|
||||
|
||||
$(dismissAll).keydown(function (e) {
|
||||
if (e.keyCode === 13 || e.keyCode === 32) {
|
||||
$(dismissAll).click();
|
||||
const handler = function (e) {
|
||||
if (!notifsData) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
$(dismissAll).click(function () {
|
||||
notifsData.forEach(function (data) {
|
||||
if (data.content.isDismissible) {
|
||||
data.content.dismissHandler();
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
Util.onClickEnter($(dismissAll), handler, { space: true });
|
||||
|
||||
return $div;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user