Skip to content

Commit c316286

Browse files
committed
MC-3484: z-index issues with MC-1416
- Cleaned up code from other changes - Removed all z-index from tabs and reworked styles to be easier to layer
1 parent cae10b9 commit c316286

File tree

7 files changed

+45
-60
lines changed

7 files changed

+45
-60
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
&.pagebuilder-tab-item {
2222
min-height: inherit;
2323

24+
&:before {
25+
background: @color-white;
26+
content: '';
27+
height: 1px;
28+
left: -1px;
29+
position: absolute;
30+
top: -2px;
31+
width: calc(~'100% + 2px');
32+
}
33+
2434
&.empty-container {
2535
min-height: 220px;
2636
}

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
.pagebuilder-content-type.pagebuilder-tabs {
1111
.tabs-navigation {
12+
border-bottom: 1px solid rgba(153, 153, 153, .3);
1213
display: block;
1314
font-size: 0;
1415
margin: 0;
@@ -21,13 +22,11 @@
2122
li.tab-header {
2223
background: @color-gray-light0;
2324
border: 1px solid @color-gray80;
24-
border-bottom: 0 !important;
2525
border-bottom-left-radius: 0 !important;
2626
border-bottom-right-radius: 0 !important;
2727
display: inline-block;
2828
margin: 0;
2929
position: relative;
30-
z-index: 1;
3130

3231
a.tab-title {
3332
border-right: 0;
@@ -114,7 +113,15 @@
114113

115114
&.ui-state-active {
116115
background: @color-white;
117-
z-index: 19;
116+
117+
&:after {
118+
border-bottom: 1px solid @color-white;
119+
bottom: -1px;
120+
content: '';
121+
left: 0;
122+
position: absolute;
123+
width: 100%;
124+
}
118125

119126
a.tab-title {
120127
position: relative;
@@ -143,7 +150,6 @@
143150
.tabs-content {
144151
border: 1px solid transparent;
145152
position: relative;
146-
z-index: 9;
147153

148154
> .element-children {
149155
min-height: inherit;

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

Lines changed: 2 additions & 24 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/content-type/text/preview.js

Lines changed: 10 additions & 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/tabs/preview.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import PreviewCollection from "../preview-collection";
3131
* @api
3232
*/
3333
export default class Preview extends PreviewCollection {
34-
public static focusOperationTime: number;
3534
public focusedTab: KnockoutObservable<number> = ko.observable();
3635
private disableInteracting: boolean;
3736
private element: Element;
@@ -50,6 +49,7 @@ export default class Preview extends PreviewCollection {
5049
}
5150
$(this.element).tabs({
5251
create: (event: Event, ui: JQueryUI.TabsCreateOrLoadUIParams) => {
52+
this.$activeTabPositioner = $(this.element).find('.active-tab-positioner');
5353
this.setFocusedTab(activeTabIndex || 0);
5454
},
5555
});
@@ -176,26 +176,6 @@ export default class Preview extends PreviewCollection {
176176
}
177177
});
178178
}
179-
180-
/**
181-
* Record the time the focus operation was completed to ensure the delay doesn't stop interaction when another
182-
* interaction has started after.
183-
*/
184-
const focusTime = new Date().getTime();
185-
Preview.focusOperationTime = focusTime;
186-
187-
/**
188-
* Keep a reference of the state of the interaction state on the stage to check if the interaction has
189-
* restarted since we started our delay timer. This resolves issues with other aspects of the system starting
190-
* an interaction during the delay period.
191-
*/
192-
let interactionState: boolean = false;
193-
events.on("stage:interactionStart", () => {
194-
interactionState = true;
195-
});
196-
events.on("stage:interactionStop", () => {
197-
interactionState = false;
198-
});
199179
}
200180

201181
/**

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,22 @@ export default class Preview extends BasePreview {
5050
* Fixes z-index issues for tabs and column
5151
*/
5252
private onFocus() {
53-
$(this.element).closest(
54-
this.config.additional_data.wysiwygConfig.parentSelectorsToUnderlay.join(",") as string,
55-
).css("z-index", 100);
53+
const $element = $(this.element);
54+
55+
$.each(this.config.additional_data.wysiwygConfig.parentSelectorsToUnderlay, (i, selector) => {
56+
$element.closest(selector as string).css("z-index", 100);
57+
});
5658
}
5759

5860
/**
5961
* Event handler for wysiwyg blur
6062
* Fixes z-index issues for tabs and column
6163
*/
6264
private onBlur() {
63-
$(this.element).closest(
64-
this.config.additional_data.wysiwygConfig.parentSelectorsToUnderlay.join(",") as string,
65-
).css("z-index", "");
65+
const $element = $(this.element);
66+
67+
$.each(this.config.additional_data.wysiwygConfig.parentSelectorsToUnderlay, (i, selector) => {
68+
$element.closest(selector as string).css("z-index", "");
69+
});
6670
}
6771
}

app/code/Magento/PageBuilder/view/base/pagebuilder/content_type/text.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@
5050
<item name="wysiwygConfig" xsi:type="array">
5151
<item name="wysiwygConfigData" xsi:type="object">Magento\PageBuilder\Model\Config\ContentType\AdditionalData\Provider\Wysiwyg\Config</item>
5252
<item name="parentSelectorsToUnderlay" xsi:type="array">
53-
<item name="0" xsi:type="string">.tabs-content</item>
54-
<item name="1" xsi:type="string">.column-container</item>
55-
<item name="2" xsi:type="string">.row-container</item>
53+
<item name="0" xsi:type="string">.column-container</item>
54+
<item name="1" xsi:type="string">.row-container</item>
5655
</item>
5756
</item>
5857
</additional_data>

0 commit comments

Comments
 (0)