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

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

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

Loading…
Cancel
Save