Skip to content

Commit 99ea425

Browse files
author
Hwashiang Yu
committed
MC-4174: Parallax Speed Values Do Not Work As Documented
- Resolved jarallax errors on full-width and full-bleed appearances
1 parent 35555e6 commit 99ea425

File tree

2 files changed

+9
-8
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

2 files changed

+9
-8
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/row/preview.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/ts/js/content-type/row/preview.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import ContentTypeConfigInterface from "../../content-type-config.d";
1313
import ConditionalRemoveOption from "../../content-type-menu/conditional-remove-option";
1414
import {OptionsInterface} from "../../content-type-menu/option.d";
1515
import ContentTypeInterface from "../../content-type.d";
16+
import DataStore from "../../data-store";
1617
import ContentTypeMountEventParamsInterface from "../content-type-mount-event-params.d";
1718
import ContentTypeReadyEventParamsInterface from "../content-type-ready-event-params.d";
1819
import ObservableUpdater from "../observable-updater";
@@ -48,10 +49,10 @@ export default class Preview extends PreviewCollection {
4849
jarallax(
4950
this.element,
5051
{
51-
imgPosition: this.data.inner.style().backgroundPosition || "50% 50%",
52-
imgRepeat: this.data.inner.style().backgroundRepeat === "0" ? "no-repeat" : "repeat",
53-
imgSize: this.data.inner.style().backgroundSize || "cover",
54-
speed: this.data.inner.attributes()["data-parallax-speed"] || 0.5,
52+
imgPosition: this.parent.dataStore.get("background_position") as string || "50% 50%",
53+
imgRepeat: this.parent.dataStore.get("background_repeat") as "repeat" | "no-repeat",
54+
imgSize: this.parent.dataStore.get("background_size") as string || "cover",
55+
speed: Number.parseFloat(this.parent.dataStore.get("parallax_speed") as string) || 0.5,
5556
},
5657
);
5758
jarallax(this.element, "onResize");

0 commit comments

Comments
 (0)