Skip to content

Commit 042fb8f

Browse files
committed
MC-5383: Option Menus, Heading Inline Editor & tinyMCE Inline Editor Are Cut Off on Full Screen View
Change wysiwygfactory signature to accommodate new stageId primitive param
1 parent 8309901 commit 042fb8f

File tree

9 files changed

+22
-17
lines changed

9 files changed

+22
-17
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/banner/preview.js

Lines changed: 1 addition & 1 deletion
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/content-type/slide/preview.js

Lines changed: 1 addition & 1 deletion
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/content-type/text/preview.js

Lines changed: 1 addition & 1 deletion
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/factory.js

Lines changed: 5 additions & 4 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/banner/preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,13 @@ export default class Preview extends BasePreview {
177177
config.adapter.settings.fixed_toolbar_container = "#" + this.parent.id + " .pagebuilder-banner-text-content";
178178

179179
WysiwygFactory(
180-
this.parent,
180+
this.parent.id,
181181
element.id,
182182
this.config.name,
183183
config,
184184
this.parent.dataStore,
185185
"message",
186+
this.parent.stageId,
186187
).then((wysiwyg: WysiwygInterface): void => {
187188
this.wysiwyg = wysiwyg;
188189
});

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/slide/preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,13 @@ export default class Preview extends BasePreview {
268268
}
269269

270270
return WysiwygFactory(
271-
this.parent,
271+
this.parent.id,
272272
this.element.id,
273273
this.config.name,
274274
wysiwygConfig,
275275
this.parent.dataStore,
276276
"content",
277+
this.parent.stageId,
277278
).then((wysiwyg: WysiwygInterface): void => {
278279
this.wysiwyg = wysiwyg;
279280
});

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/content-type/text/preview.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ export default class Preview extends BasePreview {
7373
wysiwygConfig.adapter.settings.auto_focus = this.parent.dropped ? element.id : null;
7474

7575
WysiwygFactory(
76-
this.parent,
76+
this.parent.id,
7777
element.id,
7878
this.config.name,
7979
wysiwygConfig,
8080
this.parent.dataStore,
8181
"content",
82+
this.parent.stageId,
8283
).then((wysiwyg: WysiwygInterface): void => {
8384
this.wysiwyg = wysiwyg;
8485
});

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,25 @@ import {AdditionalDataConfigInterface} from "../content-type-config";
99
import DataStore from "../data-store";
1010
import Wysiwyg from "./tinymce4";
1111
import WysiwygInterface, {WysiwygConstructorInterface} from "./wysiwyg-interface";
12-
import ContentTypeInterface from "../content-type.d";
1312

1413
/**
15-
* @param {ContentTypeInterface} contentType The content type in the registry.
14+
* @param {String} contentTypeId The ID in the registry of the content type.
1615
* @param {String} elementId The ID of the editor element in the DOM.
1716
* @param {String} contentTypeName The type of content type this editor will be used in. E.g. "banner".
1817
* @param {AdditionalDataConfigInterface} config The configuration for the wysiwyg.
1918
* @param {DataStore} dataStore The datastore to store the content in.
2019
* @param {String} fieldName The key in the provided datastore to set the data.
20+
* @param {String} stageId The ID in the registry of the stage containing the content type.
2121
* @returns {Wysiwyg}
2222
*/
2323
export default function create(
24-
contentType: ContentTypeInterface,
24+
contentTypeId: string,
2525
elementId: string,
2626
contentTypeName: string,
2727
config: AdditionalDataConfigInterface,
2828
dataStore: DataStore,
2929
fieldName: string,
30+
stageId: string,
3031
): Promise<WysiwygInterface> {
3132
config = $.extend(true, {}, config);
3233

@@ -41,7 +42,7 @@ export default function create(
4142
(ConfigModifierType: any) => {
4243
const modifier = new ConfigModifierType();
4344
// Allow dynamic settings to be set before editor is initialized
44-
modifier.modify(contentType.id, config);
45+
modifier.modify(contentTypeId, config);
4546
configResolve();
4647
},
4748
);
@@ -52,12 +53,12 @@ export default function create(
5253
}).then(() => {
5354
// Instantiate the component
5455
const wysiwyg = new WysiwygInstance(
55-
contentType.id,
56+
contentTypeId,
5657
elementId,
5758
config,
5859
dataStore,
5960
fieldName,
60-
contentType.stageId
61+
stageId,
6162
);
6263

6364
if (config.adapter_config.component_initializers

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface WysiwygConstructorInterface {
3434
*/
3535
export interface WysiwygInterface {
3636
contentTypeId: string;
37-
stageId: string,
37+
stageId: string;
3838
elementId: string;
3939
config: AdditionalDataConfigInterface;
4040

0 commit comments

Comments
 (0)