Skip to content

Commit 9dd640c

Browse files
author
Hwashiang Yu
committed
MC-5383: Option Menus, Heading Inline Editor & tinyMCE Inline Editor Are Cut Off on Full Screen View
- Resolved formatting issues in typescript - Lowercased function import - Moved toolbar variable typing back to only heading and changed reference for it
1 parent a05237d commit 9dd640c

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

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

Lines changed: 1 addition & 2 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-toolbar.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import ko from "knockout";
88
import events from "Magento_PageBuilder/js/events";
99
import {OptionInterface} from "./content-type-toolbar/option";
1010
import ValueInterface from "./content-type-toolbar/value";
11-
import Preview from "./content-type/preview";
12-
import CheckStageFullScreen from "./utils/check-stage-full-screen";
11+
import Preview from "./content-type/heading/preview";
12+
import checkStageFullScreen from "./utils/check-stage-full-screen";
1313

1414
/**
1515
* @api
@@ -62,16 +62,20 @@ export default class Toolbar {
6262
const currentContentTypeTarget = context.toolbar.getCurrentContentTypeTarget();
6363
const toolbarOptions = currentContentTypeTarget.find(".pagebuilder-toolbar-options");
6464
// Change toolbar orientation if overflow on full screen mode
65-
if (CheckStageFullScreen(context.parent.stageId)
66-
&& currentContentTypeTarget[0].getBoundingClientRect().top < toolbarOptions.outerHeight()) {
65+
if (checkStageFullScreen(context.parent.stageId)
66+
&& currentContentTypeTarget[0].getBoundingClientRect().top < toolbarOptions.outerHeight()
67+
) {
6768
context.toolbar.observer = new MutationObserver(() => {
6869
toolbarOptions.css("transform", "translateY(" + currentContentTypeTarget.outerHeight() + "px)");
6970
});
70-
context.toolbar.observer.observe(currentContentTypeTarget[0], {
71+
context.toolbar.observer.observe(
72+
currentContentTypeTarget[0],
73+
{
7174
attributes: true,
7275
childList: true,
7376
subtree: true,
74-
});
77+
},
78+
);
7579
toolbarOptions.css("transform", "translateY(" + currentContentTypeTarget.outerHeight() + "px)");
7680
} else {
7781
toolbarOptions.css("transform", "translateY(-100%)");

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {DataObject} from "../../data-store";
1616
import {moveContentType} from "../../drag-drop/move-content-type";
1717
import {getDraggedContentTypeConfig} from "../../drag-drop/registry";
1818
import {hiddenClass} from "../../drag-drop/sortable";
19-
import CheckStageFullScreen from "../../utils/check-stage-full-screen";
19+
import checkStageFullScreen from "../../utils/check-stage-full-screen";
2020
import {createStyleSheet} from "../../utils/create-stylesheet";
2121
import {default as ColumnGroupPreview} from "../column-group/preview";
2222
import BindResizeHandleEventParamsInterface from "../column/bind-resize-handle-event-params";
@@ -463,8 +463,10 @@ export default class Preview extends PreviewCollection {
463463
if (!this.gridFormOpen()) {
464464
this.gridSizeHistory = new Map();
465465
this.recordGridResize(this.gridSize());
466-
if (CheckStageFullScreen(this.parent.stageId)
467-
&& 0 > tooltip[0].getBoundingClientRect().top) { // inline tooltip out of bounds
466+
// inline tooltip out of bounds
467+
if (checkStageFullScreen(this.parent.stageId)
468+
&& 0 > tooltip[0].getBoundingClientRect().top
469+
) {
468470
this.gridToolTipOverFlow(true);
469471
}
470472
this.gridFormOpen(true);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import BasePreview from "../preview";
2020
* @api
2121
*/
2222
export default class Preview extends BasePreview {
23+
public toolbar: Toolbar;
2324
private element: Element;
2425

2526
/**

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import Edit from "../content-type-menu/edit";
2121
import Option from "../content-type-menu/option";
2222
import {OptionsInterface} from "../content-type-menu/option.d";
2323
import TitleOption from "../content-type-menu/title-option";
24-
import Toolbar from "../content-type-toolbar";
2524
import ContentTypeInterface from "../content-type.d";
2625
import {DataObject} from "../data-store";
2726
import {getDraggedContentTypeConfig} from "../drag-drop/registry";
@@ -43,7 +42,6 @@ export default class Preview {
4342
public placeholderCss: KnockoutObservable<object>;
4443
public isPlaceholderVisible: KnockoutObservable<boolean> = ko.observable(true);
4544
public isEmpty: KnockoutObservable<boolean> = ko.observable(true);
46-
public toolbar?: Toolbar;
4745

4846
/**
4947
* @deprecated

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import _ from "underscore";
1111
import WysiwygInstanceInterface from "wysiwygAdapter";
1212
import {AdditionalDataConfigInterface} from "../content-type-config";
1313
import DataStore from "../data-store";
14-
import CheckStageFullScreen from "../utils/check-stage-full-screen";
14+
import checkStageFullScreen from "../utils/check-stage-full-screen";
1515
import WysiwygInterface from "./wysiwyg-interface";
1616

1717
/**
@@ -215,7 +215,7 @@ export default class Wysiwyg implements WysiwygInterface {
215215

216216
const inlineWysiwygClientRectTop = this.getFixedToolbarContainer().get(0).getBoundingClientRect().top;
217217

218-
if (!CheckStageFullScreen(this.stageId) || $inlineToolbar.height() < inlineWysiwygClientRectTop) {
218+
if (!checkStageFullScreen(this.stageId) || $inlineToolbar.height() < inlineWysiwygClientRectTop) {
219219
$inlineToolbar.css("transform", "translateY(-100%)");
220220
return;
221221
}

0 commit comments

Comments
 (0)