droü
This commit is contained in:
@@ -194,7 +194,7 @@
|
||||
removable: true,
|
||||
draggable: true,
|
||||
copyable: true,
|
||||
droppable: false,
|
||||
droppable: true,
|
||||
'lib-id': this.get('lib-id') || '',
|
||||
'lib-kind': this.get('lib-kind') || '',
|
||||
rawHtml: this.get('rawHtml') || '',
|
||||
@@ -446,6 +446,26 @@
|
||||
}, 0);
|
||||
};
|
||||
|
||||
const ensureReferenceDropHandling = (editor) => {
|
||||
if (!editor || editor.__bridgeRefDropPatch) return;
|
||||
editor.__bridgeRefDropPatch = true;
|
||||
editor.on('component:add', (cmp) => {
|
||||
try {
|
||||
if (!cmp || typeof cmp.parent !== 'function') return;
|
||||
const parent = cmp.parent();
|
||||
if (!parent || typeof parent.get !== 'function') return;
|
||||
if (parent.get('type') !== REFERENCE_COMPONENT_TYPE) return;
|
||||
const grand = parent.parent && parent.parent();
|
||||
if (!grand || typeof grand.components !== 'function') {
|
||||
cmp.remove();
|
||||
return;
|
||||
}
|
||||
const at = grand.components().indexOf(parent) + 1;
|
||||
grand.append(cmp, { at });
|
||||
} catch {}
|
||||
});
|
||||
};
|
||||
|
||||
// --------------------------------------------------------
|
||||
// (3) HINZUGEFÜGT: Speichern-Befehl (Command)
|
||||
// --------------------------------------------------------
|
||||
@@ -770,6 +790,7 @@
|
||||
const plugin = (editor) => {
|
||||
preRegisterCategoriesAndPlaceholders(editor);
|
||||
registerReferenceComponent(editor);
|
||||
ensureReferenceDropHandling(editor);
|
||||
registerSaveCommand(editor); // HINZUGEFÜGT: Speichern-Logik
|
||||
|
||||
editor.on('load', () => {
|
||||
|
||||
Reference in New Issue
Block a user