From f4078d68f01585d04a75910c1bd5caba60de97b4 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 20 Dec 2017 11:54:30 +0100 Subject: [PATCH] Remove the 'edit username' button in the userlist in readonly mode --- www/common/toolbar3.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/www/common/toolbar3.js b/www/common/toolbar3.js index cb0152018..2d4dccd63 100644 --- a/www/common/toolbar3.js +++ b/www/common/toolbar3.js @@ -237,7 +237,7 @@ define([ var $rightCol = $('', {'class': 'cp-toolbar-userlist-rightcol'}); var $nameSpan = $('', {'class': 'cp-toolbar-userlist-name'}).text(name).appendTo($rightCol); var isMe = data.uid === user.uid; - if (isMe) { + if (isMe && !priv.readOnly) { $nameSpan.html(''); var $nameValue = $('', { 'class': 'cp-toolbar-userlist-name-value' @@ -292,7 +292,8 @@ define([ editingUserName.select[1]); setTimeout(function () { $nameInput.focus(); }); } - } else if (Common.isLoggedIn() && data.curvePublic && !friends[data.curvePublic]) { + } else if (Common.isLoggedIn() && data.curvePublic && !friends[data.curvePublic] + && !priv.readOnly) { if (pendingFriends.indexOf(data.netfluxId) !== -1) { $('', {'class': 'cp-toolbar-userlist-friend'}).text(Messages.userlist_pending) .appendTo($rightCol);