Element rebuild
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
if (window.__PLACEHOLDER_BLOCKS_LOADED) return;
|
||||
window.__PLACEHOLDER_BLOCKS_LOADED = true;
|
||||
|
||||
const TARGET_CAT_ID = 'placeholders';
|
||||
const TARGET_CAT_ID = 'placeholders';
|
||||
const SHOW_PLACEHOLDER_BLOCKS = (B && B.SHOW_PLACEHOLDER_BLOCKS === true);
|
||||
const PLACEHOLDER_COMPONENT = 'placeholder-block';
|
||||
const ALL_PLACEHOLDER_BLOCK_IDS = [];
|
||||
const INLINE_PLACEHOLDER_CLASS = 'bridge-placeholder-inline';
|
||||
@@ -1088,11 +1089,13 @@ const refreshPlaceholderComponent = (component) => {
|
||||
editor.on('load', bindRteButton, { once: true });
|
||||
}
|
||||
|
||||
addOnce(bm, 'cust-placeholder-custom', {
|
||||
id: 'cust-placeholder-custom',
|
||||
label: '🔖 Placeholder (Text)',
|
||||
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="custom" data-placeholder-key="UEBERSCHRIFT">{{UEBERSCHRIFT}}</span>`
|
||||
});
|
||||
if (SHOW_PLACEHOLDER_BLOCKS) {
|
||||
addOnce(bm, 'cust-placeholder-custom', {
|
||||
id: 'cust-placeholder-custom',
|
||||
label: '🔖 Placeholder (Text)',
|
||||
content: `<span data-gjs-type="${PLACEHOLDER_COMPONENT}" data-placeholder-type="custom" data-placeholder-key="UEBERSCHRIFT">{{UEBERSCHRIFT}}</span>`
|
||||
});
|
||||
}
|
||||
|
||||
const ensureDbBlock = (tables) => {
|
||||
const fallback = { table: 'tabelle', column: 'feld' };
|
||||
@@ -1109,6 +1112,7 @@ const refreshPlaceholderComponent = (component) => {
|
||||
const blockId = 'cust-placeholder-db';
|
||||
const label = '🗄️ Placeholder (DB)';
|
||||
const existing = typeof bm.get === 'function' ? bm.get(blockId) : null;
|
||||
if (!SHOW_PLACEHOLDER_BLOCKS) return;
|
||||
if (existing && typeof existing.set === 'function') {
|
||||
existing.set('content', content);
|
||||
existing.set('label', label);
|
||||
|
||||
Reference in New Issue
Block a user