', {'class': 'fa fa-user'});
var $button = $('').append($icon).append($displayedName.clone());
if (account) {
- $button.append('(' + accountName + ')');
+ $button.append($('', {'class': 'account-name'}).text('(' + accountName + ')'));
}
var dropdownConfig = {
text: $button.html(), // Button initial text
@@ -406,7 +416,7 @@ define([
window.location.reload();
});
$userAdmin.find('a.login').click(function (e) {
- window.open = '/user';
+ window.open('/user');
});
if (config.userName && config.userName.setName && config.userName.lastName) {
@@ -510,7 +520,7 @@ define([
var $titleElement = createTitle(toolbar.find('.' + TOP_CLS), readOnly, config.title, Cryptpad);
var $linkElement = createLinkToMain(toolbar.find('.' + TOP_CLS));
var lagElement = createLagElement();
- var $userAdminElement = createUserAdmin(toolbar.find('.' + TOP_CLS), config, lagElement, Cryptpad);
+ var $userAdminElement = createUserAdmin(toolbar.find('.' + TOP_CLS), config, readOnly, lagElement, Cryptpad);
var spinner = createSpinner($userAdminElement, config);
var userData = config.userData;
// readOnly = 1 (readOnly enabled), 0 (disabled), -1 (old pad without readOnly mode)
diff --git a/www/drive/main.js b/www/drive/main.js
index e0c93e097..308beed83 100644
--- a/www/drive/main.js
+++ b/www/drive/main.js
@@ -158,7 +158,7 @@ define([
if (!APP.readOnly) {
getLastName(function (err, lastName) {
APP.userName.lastName = lastName;
- APP.$displayName.text(lastName);
+ APP.$displayName.text(lastName || Messages.anonymous);
});
} else {
APP.$displayName.html('' + Messages.readonly + '');
diff --git a/www/pad/main.js b/www/pad/main.js
index 7930e659f..e0a7bc4f8 100644
--- a/www/pad/main.js
+++ b/www/pad/main.js
@@ -590,7 +590,7 @@ define([
var $userBlock = $bar.find('.' + Toolbar.constants.username);
var $editShare = $bar.find('.' + Toolbar.constants.editShare);
var $viewShare = $bar.find('.' + Toolbar.constants.viewShare);
- var $usernameButton = module.$userNameButton = $bar.find('.' + Toolbar.constants.changeUsername);
+ var $usernameButton = module.$userNameButton = $($bar.find('.' + Toolbar.constants.changeUsername));
var editHash;
var viewHash = Cryptpad.getViewHashFromKeys(info.channel, secret.keys);
diff --git a/www/poll/main.js b/www/poll/main.js
index 64b53e350..ab696ecb5 100644
--- a/www/poll/main.js
+++ b/www/poll/main.js
@@ -674,6 +674,7 @@ define([
var $userBlock = $bar.find('.' + Toolbar.constants.username);
var $editShare = $bar.find('.' + Toolbar.constants.editShare);
var $viewShare = $bar.find('.' + Toolbar.constants.viewShare);
+ var $usernameButton = APP.$userNameButton = $($bar.find('.' + Toolbar.constants.changeUsername));
/* add a forget button */
var forgetCb = function (err, title) {
diff --git a/www/slide/main.js b/www/slide/main.js
index 729d54921..4becaa0f0 100644
--- a/www/slide/main.js
+++ b/www/slide/main.js
@@ -440,6 +440,7 @@ define([
var $userBlock = $bar.find('.' + Toolbar.constants.username);
var $editShare = $bar.find('.' + Toolbar.constants.editShare);
var $viewShare = $bar.find('.' + Toolbar.constants.viewShare);
+ var $usernameButton = module.$userNameButton = $($bar.find('.' + Toolbar.constants.changeUsername));
var editHash;
var viewHash = Cryptpad.getViewHashFromKeys(info.channel, secret.keys);