Skip to content

Commit af2dc90

Browse files
committed
#514: User sees content snapshot on Category Page in Admin Panel - Added CR fixes and reverted animation on CMS pages
1 parent 668f008 commit af2dc90

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
.pagebuilder-panel-wrapper {
5050
-moz-transition: opacity .75s ease-in-out, visibility .75s ease-in-out;
5151
-webkit-transition: opacity .75s ease-in-out, visibility .75s ease-in-out;
52-
display: none;
5352
float: left;
5453
opacity: 0;
5554
position: relative;
@@ -65,10 +64,8 @@
6564
}
6665

6766
&.visible {
68-
display: block;
6967
opacity: 1;
7068
visibility: visible;
71-
z-index: 1;
7269

7370
&.sticky-top {
7471
position: fixed;

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

Lines changed: 5 additions & 3 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/content-type/preview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-->
77
<div class="pagebuilder-stage"
88
attr="id: id, 'data-role': 'pagebuilder-stage'"
9-
ko-style="$parent.stageStyles"
9+
ko-style="pageBuilder.stageStyles"
1010
css="'pagebuilder-show-borders': showBorders, 'pagebuilder-no-user-select': !userSelect(), 'panel-collapsed': pageBuilder.panel.isCollapsed, 'interacting': interacting, 'focus-child': focusChild">
1111
<div class="pagebuilder-stage-loading" visible="loading">
1212
<span class="spinner">

app/code/Magento/PageBuilder/view/adminhtml/web/template/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
-->
77

88
<div id="pagebuilder-panel-wrapper" class="pagebuilder-panel-wrapper"
9-
css="visible: isVisible, 'sticky-top': isStickyTop, 'sticky-bottom': isStickyBottom, 'transition-out': $parent.isSnapshotTransition"
9+
css="visible: isVisible, 'sticky-top': isStickyTop, 'sticky-bottom': isStickyBottom, 'transition-out': pageBuilder.isSnapshotTransition"
1010
afterRender="afterRender">
1111
<div id="pagebuilder-panel" class="pagebuilder-panel">
1212
<div class="search-content-types">

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export default class PageBuilder implements PageBuilderInterface {
3131
public initialValue: string;
3232
public id: string = utils.uniqueid();
3333
public originalScrollTop: number = 0;
34-
public snapshot: boolean;
3534
public isFullScreen: KnockoutObservable<boolean> = ko.observable(false);
3635
public isSnapshot: KnockoutObservable<boolean> = ko.observable(false);
3736
public isSnapshotTransition: KnockoutObservable<boolean> = ko.observable(false);
@@ -42,6 +41,7 @@ export default class PageBuilder implements PageBuilderInterface {
4241
public isAllowedTemplateApply: boolean;
4342
private previousStyles: {[key: string]: string} = {};
4443
private previousPanelHeight: number;
44+
private snapshot: boolean;
4545

4646
constructor(config: any, initialValue: string) {
4747
Config.setConfig(config);
@@ -98,10 +98,12 @@ export default class PageBuilder implements PageBuilderInterface {
9898
this.isFullScreen(!this.isFullScreen());
9999
return;
100100
}
101+
101102
const stageWrapper = $("#" + this.stage.id).parent();
102103
const pageBuilderWrapper = stageWrapper.parents(".pagebuilder-wysiwyg-wrapper");
103104
const panel = stageWrapper.find(".pagebuilder-panel");
104105
stageWrapper.scrollTop(0);
106+
105107
if (!this.isFullScreen()) {
106108
pageBuilderWrapper.css("height", pageBuilderWrapper.outerHeight());
107109
this.previousPanelHeight = panel.outerHeight();
@@ -120,14 +122,15 @@ export default class PageBuilder implements PageBuilderInterface {
120122
zIndex: "800",
121123
width: stageWrapper.outerWidth().toString() + "px",
122124
};
123-
this.isFullScreen(true);
125+
124126
if (this.snapshot) {
125127
this.isSnapshot(false);
126128
this.stageStyles(this.previousStyles);
127129
} else {
128130
this.wrapperStyles(this.previousStyles);
129131
}
130132

133+
this.isFullScreen(true);
131134
_.defer(() => {
132135
// Remove all styles we applied to fix the position once we're transitioning
133136
panel.css("height", "");
@@ -152,7 +155,9 @@ export default class PageBuilder implements PageBuilderInterface {
152155
this.stageStyles(this.previousStyles)
153156
} else {
154157
this.wrapperStyles(this.previousStyles);
158+
this.isFullScreen(false);
155159
}
160+
156161
panel.css("height", this.previousPanelHeight + "px");
157162
// Wait for the 350ms animation to complete before changing these properties back
158163
_.delay(() => {
@@ -164,14 +169,15 @@ export default class PageBuilder implements PageBuilderInterface {
164169
return Object.assign(object, {[styleName]: ""});
165170
}, {}),
166171
);
172+
this.isFullScreen(false);
167173
} else {
168174
this.wrapperStyles(Object.keys(this.previousStyles)
169175
.reduce((object: object, styleName: string) => {
170176
return Object.assign(object, {[styleName]: ""});
171177
}, {}),
172178
);
173179
}
174-
this.isFullScreen(false);
180+
175181
panel.css("height", "");
176182
pageBuilderWrapper.css("height", "");
177183
this.previousStyles = {};

0 commit comments

Comments
 (0)