mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Fix sidebar-layout issue with async content
This commit is contained in:
parent
0637911083
commit
2722d8bdbf
@ -270,8 +270,17 @@ define([
|
||||
|
||||
sidebar.addItem = (key, get, options) => {
|
||||
const safeKey = keyToCamlCase(key);
|
||||
const div = h(`div.cp-sidebarlayout-element`, {
|
||||
'data-item': key,
|
||||
style: 'display:none;'
|
||||
});
|
||||
items[key] = div;
|
||||
$rightside.append(div);
|
||||
get((content) => {
|
||||
if (content === false) { return; }
|
||||
if (content === false) {
|
||||
delete items[key];
|
||||
return void $(div).remove();
|
||||
}
|
||||
options = options || {};
|
||||
const title = options.noTitle ? undefined : h('label.cp-item-label', {
|
||||
id: `cp-${app}-${key}`
|
||||
@ -281,16 +290,7 @@ define([
|
||||
if (hint && options.htmlHint) {
|
||||
hint.innerHTML = Messages[`${app}_${safeKey}Hint`];
|
||||
}
|
||||
const div = h(`div.cp-sidebarlayout-element`, {
|
||||
'data-item': key,
|
||||
style: 'display:none;'
|
||||
}, [
|
||||
title,
|
||||
hint,
|
||||
content
|
||||
]);
|
||||
items[key] = div;
|
||||
$rightside.append(div);
|
||||
$(div).append(title).append(hint).append(content);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user