Skip to content

Commit 668f008

Browse files
committed
#514: User sees content snapshot on Category Page in Admin Panel - Added CR fixes
1 parent b351e8d commit 668f008

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
// Animations
5454
// _____________________________________________
5555

56-
5756
.keyframes (@name; @arguments) {
5857
@-moz-keyframes @name {
5958
@arguments();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
}
339339

340340
.pagebuilder-stage {
341-
width: calc(~"100% - 150px");
341+
width: calc(~'100% - 150px');
342342
top: 0;
343343
left: 0;
344344
position: relative;

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

Lines changed: 8 additions & 9 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/page-builder.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default class PageBuilder implements PageBuilderInterface {
3131
public initialValue: string;
3232
public id: string = utils.uniqueid();
3333
public originalScrollTop: number = 0;
34-
public snapshot:KnockoutObservable<boolean> = ko.observable(false);
34+
public snapshot: boolean;
3535
public isFullScreen: KnockoutObservable<boolean> = ko.observable(false);
3636
public isSnapshot: KnockoutObservable<boolean> = ko.observable(false);
3737
public isSnapshotTransition: KnockoutObservable<boolean> = ko.observable(false);
@@ -51,7 +51,7 @@ export default class PageBuilder implements PageBuilderInterface {
5151
this.isFullScreen(config.isFullScreen);
5252
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);
@@ -111,17 +111,17 @@ export default class PageBuilder implements PageBuilderInterface {
111111
* screen.
112112
*/
113113
const xPosition = parseInt(stageWrapper.offset().top.toString(), 10) -
114-
parseInt($(window).scrollTop().toString(), 10) - (this.snapshot() ? 63 : 0);
115-
const yPosition = stageWrapper.offset().left - (this.snapshot() ? 150 : 0);
114+
parseInt($(window).scrollTop().toString(), 10) - (this.snapshot ? 63 : 0);
115+
const yPosition = stageWrapper.offset().left - (this.snapshot ? 150 : 0);
116116
this.previousStyles = {
117-
position: this.snapshot() ? "relative" : "fixed",
117+
position: this.snapshot ? "relative" : "fixed",
118118
top: `${xPosition}px`,
119119
left: `${yPosition}px`,
120120
zIndex: "800",
121121
width: stageWrapper.outerWidth().toString() + "px",
122122
};
123123
this.isFullScreen(true);
124-
if (this.snapshot()) {
124+
if (this.snapshot) {
125125
this.isSnapshot(false);
126126
this.stageStyles(this.previousStyles);
127127
} else {
@@ -131,7 +131,7 @@ export default class PageBuilder implements PageBuilderInterface {
131131
_.defer(() => {
132132
// Remove all styles we applied to fix the position once we're transitioning
133133
panel.css("height", "");
134-
if (this.snapshot()) {
134+
if (this.snapshot) {
135135
this.stageStyles(Object.keys(this.previousStyles)
136136
.reduce((object: object, styleName: string) => {
137137
return Object.assign(object, {[styleName]: ""});
@@ -147,7 +147,7 @@ export default class PageBuilder implements PageBuilderInterface {
147147
});
148148
} else {
149149
// When leaving full screen mode just transition back to the original state
150-
if (this.snapshot()) {
150+
if (this.snapshot) {
151151
this.isSnapshotTransition(true);
152152
this.stageStyles(this.previousStyles)
153153
} else {
@@ -156,7 +156,7 @@ export default class PageBuilder implements PageBuilderInterface {
156156
panel.css("height", this.previousPanelHeight + "px");
157157
// Wait for the 350ms animation to complete before changing these properties back
158158
_.delay(() => {
159-
if (this.snapshot()) {
159+
if (this.snapshot) {
160160
this.isSnapshot(true);
161161
this.isSnapshotTransition(false);
162162
this.stageStyles(Object.keys(this.previousStyles)

0 commit comments

Comments
 (0)