Skip to content

Commit a784669

Browse files
committed
#514: User sees content snapshot on Category Page in Admin Panel - Fixed MouseOver events, added mouseover events to Edit in PB button, fixed styles
1 parent 6155531 commit a784669

File tree

6 files changed

+26
-18
lines changed

6 files changed

+26
-18
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_config.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363
}
6464

65-
.admin__field-page-builder {
65+
.admin__field-wide.admin__field-page-builder {
6666
margin-top: @indent__l;
6767

6868
button.action-default {

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_page-builder.less

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@stage-overlay-border: #4181E4;
99

1010
.pagebuilder-header {
11+
display: none;
1112
opacity: 0;
1213
text-align: right;
1314

@@ -22,6 +23,7 @@
2223
}
2324

2425
&.visible {
26+
display: block;
2527
opacity: 1;
2628
visibility: visible;
2729
}
@@ -69,6 +71,7 @@
6971
background: @color-very-dark-grayish-orange;
7072
border: none;
7173
border-bottom: 1px solid @color-brownie-almost;
74+
display: block;
7275
left: 150px;
7376
opacity: 0;
7477
padding: 0;
@@ -95,6 +98,7 @@
9598
&.visible {
9699
opacity: 1;
97100
visibility: visible;
101+
display: block;
98102
}
99103
}
100104

@@ -142,9 +146,6 @@
142146
}
143147
}
144148

145-
.page-builder-wysiwyg-wrapper {
146-
position: relative;
147-
}
148149

149150
.pagebuilder-wysiwyg-overlay {
150151
display: none;
@@ -178,6 +179,10 @@
178179
}
179180
}
180181

182+
.pagebuilder-wysiwyg-wrapper {
183+
position: relative;
184+
}
185+
181186
.pagebuilder-wysiwyg-wrapper.pagebuilder-transition-out .pagebuilder-stage-wrapper {
182187
.pagebuilder-stage-wrapper.stage-full-screen;
183188

app/code/Magento/PageBuilder/view/adminhtml/web/css/source/_panel.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
transition: opacity .75s ease-in-out, visibility .75s ease-in-out;
5959
visibility: hidden;
6060
width: 150px;
61+
display: none;
6162

6263
&.no-position-sticky {
6364
top: 0;
@@ -66,6 +67,7 @@
6667
&.visible {
6768
opacity: 1;
6869
visibility: visible;
70+
display: block;
6971

7072
&.sticky-top {
7173
position: fixed;

app/code/Magento/PageBuilder/view/adminhtml/web/js/page-builder.js

Lines changed: 2 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/template/form/element/wysiwyg.html

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,29 @@
55
*/
66
-->
77

8-
<div visible="visible" css="{'_disabled': disabled}" class="page-builder-wysiwyg-wrapper">
8+
<div visible="visible" css="{'_disabled': disabled}">
99
<button if="wysiwygConfigData()['pagebuilder_button'] || wysiwygConfigData()['pagebuilder_content_snapshot']"
1010
type="button"
1111
class="action-default action"
1212
ko-disabled="disabled"
13-
click="pageBuilderEditButtonClick.bind($data)">
13+
click="pageBuilderEditButtonClick.bind($data)"
14+
event="{ mouseover: pageBuilder.onStageOverlayMouseOver, mouseout: pageBuilder.onStageOverlayMouseOut }, mouseoverBubble: false">
1415
<span translate="pageBuilderEditButtonText" />
1516
</button>
1617
<if args="isComponentInitialized">
1718
<div visible="visiblePageBuilder"
1819
class="pagebuilder-wysiwyg-wrapper"
1920
css="{'pagebuilder-transition-in': wysiwygConfigData()['pagebuilder_button'] && !wysiwygConfigData()['pagebuilder_content_snapshot'], 'trigger-transition': transition, 'pagebuilder-transition-out': transitionOut}">
20-
<with args="pageBuilder">
21+
<div if="wysiwygConfigData()['pagebuilder_content_snapshot']"
22+
class="pagebuilder-wysiwyg-overlay"
23+
click="pageBuilderEditButtonClick.bind($data)"
24+
css="'visible': !pageBuilder.isFullScreen()"
25+
event="{ mouseover: pageBuilder.onStageOverlayMouseOver, mouseout: pageBuilder.onStageOverlayMouseOut }, mouseoverBubble: false"
26+
tabindex="0">
27+
</div>
28+
<with args="pageBuilder">
2129
<render />
2230
</with>
2331
</div>
2432
</if>
25-
<div if="wysiwygConfigData()['pagebuilder_content_snapshot']"
26-
class="pagebuilder-wysiwyg-overlay"
27-
click="pageBuilderEditButtonClick.bind($data)"
28-
css="'visible': !pageBuilder.isFullScreen()"
29-
event="{ mouseover: pageBuilder.onStageOverlayMouseOver, mouseout: pageBuilder.onStageOverlayMouseOut }, mouseoverBubble: false"
30-
tabindex="0">
31-
</div>
3233
</div>

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/page-builder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ export default class PageBuilder implements PageBuilderInterface {
104104
* MouseOver event for Stage Overlay
105105
*/
106106
public onStageOverlayMouseOver (): void {
107-
$('.pagebuilder-stage-overlay').addClass('_hover');
107+
$('.pagebuilder-wysiwyg-overlay').addClass('_hover');
108108
}
109109

110110
/**
111111
* MouseOut event for Stage Overlay
112112
*/
113113
public onStageOverlayMouseOut (): void {
114-
$('.pagebuilder-stage-overlay').removeClass('_hover');
114+
$('.pagebuilder-wysiwyg-overlay').removeClass('_hover');
115115
}
116116

117117
/**

0 commit comments

Comments
 (0)