Skip to content

Commit c5f8dfb

Browse files
#514: User sees content snapshot on Category page in Admin Panel #1
- fix panel animation - fix panel visiblity - fix default snapshot value
1 parent deb5807 commit c5f8dfb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

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

Lines changed: 4 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/template/panel.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
-->
77

88
<div id="pagebuilder-panel-wrapper" class="pagebuilder-panel-wrapper" visible="!pageBuilder.isSnapshot()"
9-
css="'sticky-top': isStickyTop, 'sticky-bottom': isStickyBottom, 'transition-out': pageBuilder.isSnapshotTransition"
10-
afterRender="afterRender">
9+
css="visible: isVisible(), 'sticky-top': isStickyTop, 'sticky-bottom': isStickyBottom, 'transition-out': pageBuilder.isSnapshotTransition"
10+
afterRender="afterRender">
1111
<div id="pagebuilder-panel" class="pagebuilder-panel">
1212
<div class="search-content-types">
1313
<label for="search-content-types-input"></label>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export default class PageBuilder implements PageBuilderInterface {
4949
this.preloadTemplates(config);
5050
this.initialValue = initialValue;
5151
this.isFullScreen(config.isFullScreen);
52-
this.isSnapshot(config.pagebuilder_content_snapshot);
52+
this.isSnapshot(!!config.pagebuilder_content_snapshot);
5353
this.isSnapshotTransition(false);
54-
this.snapshot = config.pagebuilder_content_snapshot;
54+
this.snapshot = !!config.pagebuilder_content_snapshot;
5555
this.config = config;
5656

5757
this.isAllowedTemplateApply = isAllowed(resources.TEMPLATE_APPLY);
@@ -109,8 +109,6 @@ export default class PageBuilder implements PageBuilderInterface {
109109

110110
if (!this.isFullScreen()) {
111111
pageBuilderWrapper.css("height", pageBuilderWrapper.outerHeight());
112-
this.previousPanelHeight = panel.outerHeight();
113-
panel.css("height", this.previousPanelHeight + "px");
114112
/**
115113
* Fix the stage in the exact place it is when it's part of the content and allow it to transition to full
116114
* screen.
@@ -130,6 +128,8 @@ export default class PageBuilder implements PageBuilderInterface {
130128
this.isSnapshot(false);
131129
this.stageStyles(this.previousStyles);
132130
} else {
131+
this.previousPanelHeight = panel.outerHeight();
132+
panel.css("height", this.previousPanelHeight + "px");
133133
this.wrapperStyles(this.previousStyles);
134134
}
135135

0 commit comments

Comments
 (0)