Merge branch 'profile-layout' of github.com:cryptpad/cryptpad into profile-layout

This commit is contained in:
yflory 2025-03-24 16:20:16 +01:00
commit 219cc2a3e4
2 changed files with 18 additions and 2 deletions

View File

@ -22,6 +22,9 @@
display: none !important;
}
.cp-app-profile-section:first-child {
margin-top: 1rem;
}
#cp-app-profile-header {
display: flex;
@ -172,9 +175,15 @@
#cp-app-profile-description {
position: relative;
font-size: 16px;
max-width: 100%;
//margin-bottom: 20px;
.cp-app-profile-description-code {
display: none;
.cp-markdown-toolbar {
display: flex;
height: auto;
flex-wrap: wrap;
}
}
#cp-app-profile-description-info {
overflow-wrap: anywhere;

View File

@ -134,7 +134,7 @@ define([
};
var addDisplayName = function ($container) {
var $block = $('<div>', {'class': DISPLAYNAME_ID}).appendTo($container);
var $block = $('<div>', {'class': PROFILE_SECTION}).appendTo($container);
APP.$name = $('<span>', {'class': DISPLAYNAME_ID}).appendTo($block);
};
var refreshName = function (data) {
@ -619,7 +619,11 @@ define([
};
var updateValues = APP.updateValues = function (data) {
refreshAvatar(data);
// Only update avatar if it has changed
if (!APP._lastUpdate || APP._lastUpdate.avatar !== data.avatar) {
refreshAvatar(data);
}
// Always update other profile information
refreshName(data);
refreshLink(data);
refreshDescription(data);
@ -627,6 +631,7 @@ define([
refreshMute(data);
setPublicKeyButton(data);
setCopyDataButton(data);
APP._lastUpdate = data;
};
var createToolbar = function () {
@ -750,6 +755,8 @@ define([
if (JSON.stringify(lm.proxy) === '{}') {
return void onCorruptedCache();
}
// Force avatar update on initial load
APP._lastUpdate = null;
updateValues(lm.proxy);
UI.removeLoadingScreen();
common.mailbox.subscribe(["notifications"], {