Skip to content

Commit 7dea8e2

Browse files
AC-397: TinyMCE 5 modal is not center over toolbar
1 parent 199ee1c commit 7dea8e2

File tree

5 files changed

+27
-33
lines changed

5 files changed

+27
-33
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/content-type/slide/_default.less

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,6 @@
6363
left: -1px !important;
6464
right: -1px;
6565
}
66-
.tox-dialog-wrap {
67-
width: inherit;
68-
69-
.tox-dialog-wrap__backdrop {
70-
height: 120%;
71-
}
72-
.tox-dialog {
73-
max-height: none;
74-
}
75-
}
7666
.pagebuilder-empty-slide {
7767
left: 0;
7868
pointer-events: none;

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/slide/wysiwyg/tinymce/component-initializer.js

Lines changed: 3 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/js/wysiwyg/tinymce.js

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/slide/wysiwyg/tinymce/component-initializer.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,6 @@ export default class ComponentInitializer implements WysiwygComponentInitializer
128128
() => !this.slideChanging,
129129
10,
130130
);
131-
132-
// Wait for everything else to finish
133-
_.defer(() => {
134-
// Add width for tinymce modal
135-
$(this.activeSlideSelector).find(".tox-tinymce-aux").css(
136-
"width",
137-
$(this.activeSlideSelector).width(),
138-
);
139-
});
140131
}
141132

142133
/**
@@ -161,8 +152,5 @@ export default class ComponentInitializer implements WysiwygComponentInitializer
161152
if (this.autoplay) {
162153
$slider.parent().slick("slickPlay");
163154
}
164-
165-
// Revert width for tinymce modal
166-
$(this.activeSlideSelector).find(".tox-tinymce-aux").css("width", "");
167155
}
168156
}

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/wysiwyg/tinymce.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ export default class Wysiwyg implements WysiwygInterface {
195195
});
196196
this.resizeObserver.observe($inlineToolbar.get(0));
197197
}
198+
const dialogContainer = document.querySelector(`#${this.elementId} ~ .tox-tinymce-aux`);
199+
if (!!dialogContainer) {
200+
dialogContainer.setAttribute('data-editor-aux', this.elementId);
201+
document.body.appendChild(dialogContainer);
202+
}
198203
});
199204
}
200205

@@ -220,6 +225,12 @@ export default class Wysiwyg implements WysiwygInterface {
220225
}
221226
this.toolbarHeight = 0;
222227

228+
const dialogContainer = document.querySelector(`[data-editor-aux=${this.elementId}]`);
229+
if (!!dialogContainer) {
230+
dialogContainer.removeAttribute('data-editor-aux');
231+
document.querySelector(`#${this.elementId}`).parentNode.appendChild(dialogContainer);
232+
}
233+
223234
events.trigger("stage:interactionStop");
224235
}
225236

0 commit comments

Comments
 (0)