Skip to content

Commit e1c9c75

Browse files
author
Mateusz Dębiński
committed
Merge remote-tracking branch 'origin/4.6'
2 parents 113dd0b + b58bebc commit e1c9c75

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,17 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0;
308308

309309
updateInput(initialData, false);
310310

311-
this.editor.model.document.on('change:data', () => {
311+
this.editor.model.document.on('change:data', (eventInfo) => {
312312
const data = this.getData();
313+
const changes = Array.from(eventInfo.source.differ.getChanges());
314+
const shouldFireInputEventAttribute = changes.find(
315+
(change) => change.type === 'attribute' && change.attributeKey === 'shouldFireInputEvent',
316+
);
317+
if (shouldFireInputEventAttribute && typeof shouldFireInputEventAttribute.attributeNewValue === 'boolean') {
318+
updateInput(data, shouldFireInputEventAttribute.attributeNewValue);
319+
320+
return;
321+
}
313322

314323
updateInput(data);
315324
});

src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class IbexaEmbedContentInlineEditing extends Plugin {
163163
writer.setAttribute('contentId', contentId, modelElement);
164164
writer.setAttribute('locationId', locationId, modelElement);
165165
writer.setAttribute('languageCodes', languageCodes, modelElement);
166+
writer.setAttribute('shouldFireInputEvent', false, modelElement);
166167
});
167168
});
168169

src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class IbexaEmbedContentEditing extends Plugin {
165165
writer.setAttribute('contentId', contentId, modelElement);
166166
writer.setAttribute('locationId', locationId, modelElement);
167167
writer.setAttribute('languageCodes', languageCodes, modelElement);
168+
writer.setAttribute('shouldFireInputEvent', false, modelElement);
168169
});
169170
});
170171

src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class IbexaEmbedImageEditing extends Plugin {
5656
.then((imageData) => {
5757
this.editor.model.change((writer) => {
5858
writer.setAttribute('previewUrl', imageData.ContentImageVariation.uri, modelElement);
59+
writer.setAttribute('shouldFireInputEvent', false, modelElement);
5960
});
6061
})
6162
.catch(window.ibexa.helpers.notification.showErrorNotification);

0 commit comments

Comments
 (0)