asdasd
This commit is contained in:
@@ -1041,7 +1041,8 @@ const refreshPlaceholderComponent = (component) => {
|
|||||||
fetchPlaceholderSchema().catch(() => {});
|
fetchPlaceholderSchema().catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!editor.Commands.get('bridge-placeholder:edit')) {
|
const existingCmd = editor.Commands.get('bridge-placeholder:edit');
|
||||||
|
if (!existingCmd || existingCmd.__bridgePlaceholderStub) {
|
||||||
editor.Commands.add('bridge-placeholder:edit', {
|
editor.Commands.add('bridge-placeholder:edit', {
|
||||||
run(ed, sender, opts = {}) {
|
run(ed, sender, opts = {}) {
|
||||||
const component = opts.component || ed.getSelected();
|
const component = opts.component || ed.getSelected();
|
||||||
|
|||||||
@@ -1108,6 +1108,23 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ensurePlaceholderCommandStub = (editor) => {
|
||||||
|
if (!editor || !editor.Commands) return;
|
||||||
|
const existing = editor.Commands.get && editor.Commands.get('bridge-placeholder:edit');
|
||||||
|
if (existing) return;
|
||||||
|
editor.Commands.add('bridge-placeholder:edit', {
|
||||||
|
__bridgePlaceholderStub: true,
|
||||||
|
run(ed, sender, opts = {}) {
|
||||||
|
if (sender && sender.set) sender.set('active', 0);
|
||||||
|
const component = opts.component || (ed.getSelected && ed.getSelected());
|
||||||
|
if (window.BridgeBlocksPlaceholder && typeof window.BridgeBlocksPlaceholder.openModal === 'function') {
|
||||||
|
window.BridgeBlocksPlaceholder.openModal(ed, component);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
ensurePlaceholderCommandStub(ed);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const textTags = ['p','span','div','br','b','strong','i','em','u','a','ul','ol','li'];
|
const textTags = ['p','span','div','br','b','strong','i','em','u','a','ul','ol','li'];
|
||||||
if (ed.Config) {
|
if (ed.Config) {
|
||||||
|
|||||||
Reference in New Issue
Block a user