pull/1/head
yflory 4 years ago
parent 3ace3eaa91
commit a41d70ab6b

@ -23,12 +23,6 @@
width: 30px;
}
padding: 0 5px;
&.admin {
cursor: pointer;
&:hover {
background-color: @cp_dropdown-bg-hover;
}
}
}
.cp-avatar {
.avatar_main(30px);

@ -7,10 +7,8 @@ define([
'/common/common-ui-elements.js',
'/common/notifications.js',
'/common/hyperscript.js',
'/common/clipboard.js',
'/customize/messages.js',
], function ($, ApiConfig, Util, Hash, UI, UIElements, Notifications, h,
Clipboard, Messages) {
], function ($, ApiConfig, Util, Hash, UI, UIElements, Notifications, h, Messages) {
var Mailbox = {};
Mailbox.create = function (Common) {
@ -65,17 +63,9 @@ define([
}
if (data.type === 'broadcast') {
var urlArgs = Util.find(ApiConfig, ['requireConf', 'urlArgs']) || '';
var adminCls = Common.isAdmin() ? '.admin' : '';
avatar = h('span.cp-broadcast'+adminCls, h('img', {
avatar = h('span.cp-broadcast', h('img', {
src: '/customize/CryptPad_logo.svg?' + urlArgs,
title: adminCls ? 'Copy UID' : '' // XXX
}));
if (adminCls) {
$(avatar).click(function () {
var success = Clipboard.copy(Util.find(data, ['content', 'msg', 'uid']));
if (success) { UI.log(Messages.shareSuccess); }
});
}
} else if (userData && typeof(userData) === "object" && userData.profile) {
avatar = h('span.cp-avatar');
Common.displayAvatar($(avatar), userData.avatar, userData.displayName || userData.name);

Loading…
Cancel
Save