Skip to content

Commit d18ffeb

Browse files
PB-265: Video background for Banner
- fix tinymce zindex overlapping sibling banner
1 parent 82557e6 commit d18ffeb

File tree

3 files changed

+39
-13
lines changed

3 files changed

+39
-13
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,23 @@
117117
.pagebuilder-overlay {
118118
padding: 30px;
119119
position: relative;
120+
z-index: 2;
120121
}
121122

122123
.video-overlay {
123-
z-index: auto;
124+
z-index: 1;
124125
}
125126

126127
&.jarallax {
127-
position: unset!important;
128+
z-index: auto!important;
128129
}
129130

130131
[id*='jarallax-container'] {
131-
z-index: auto!important;
132+
z-index: 0!important;
132133

133134
> iframe,
134135
> video {
135-
z-index: auto!important;
136+
z-index: 0!important;
136137
}
137138
}
138139
}

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

Lines changed: 12 additions & 5 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: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ export default class Preview extends BasePreview {
7878
"video_source",
7979
];
8080

81+
/**
82+
* Selector for banner overlay
83+
*/
84+
private bannerOverlaySelector = ".pagebuilder-overlay";
85+
86+
/**
87+
* Default banner overlay z-index
88+
*/
89+
private defaultOverlayZIndex = 2;
90+
91+
/**
92+
* Banner overlay z-index with active editor
93+
*/
94+
private activeEditorOverlayZIndex = 3;
95+
8196
/**
8297
* Debounce and defer the init of Jarallax
8398
*
@@ -114,9 +129,6 @@ export default class Preview extends BasePreview {
114129
speed: 1,
115130
videoPlayOnlyVisible: (this.contentType.dataStore.get("video_play_only_visible") as string) === "true",
116131
videoLazyLoading: (this.contentType.dataStore.get("video_lazy_load") as string) === "true",
117-
onInit() {
118-
$(this.image.$container).prependTo($(this.image.$container).parent());
119-
},
120132
},
121133
);
122134
// @ts-ignore
@@ -237,7 +249,13 @@ export default class Preview extends BasePreview {
237249

238250
if (focus) {
239251
wysiwygConfig.adapter.settings.auto_focus = this.element.id;
240-
wysiwygConfig.adapter.settings.init_instance_callback = () => {
252+
wysiwygConfig.adapter.settings.init_instance_callback = (editor) => {
253+
editor.on("focus", () => {
254+
$(this.element).parents(this.bannerOverlaySelector).zIndex(this.activeEditorOverlayZIndex);
255+
});
256+
editor.on("blur", () => {
257+
$(this.element).parents(this.bannerOverlaySelector).zIndex(this.defaultOverlayZIndex);
258+
});
241259
_.defer(() => {
242260
this.element.blur();
243261
this.element.focus();

0 commit comments

Comments
 (0)