Skip to content

Commit 2db84df

Browse files
committed
MC-3775: Button editable state is not consistent with the options panel appearing
- Fix slider duplication issue
1 parent b573fd3 commit 2db84df

File tree

2 files changed

+16
-18
lines changed
  • app/code/Magento/PageBuilder/view/adminhtml/web

2 files changed

+16
-18
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/content-type/slide/preview.js

Lines changed: 5 additions & 6 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/slide/preview.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ export default class Preview extends BasePreview {
140140
* @returns {Uploader}
141141
*/
142142
public getUploader() {
143+
const dataStore = this.parent.dataStore.get() as any[];
144+
const initialImageValue = dataStore[this.config.additional_data.uploaderConfig.dataScope] || "";
145+
146+
// Create uploader
147+
this.uploader = new Uploader(
148+
"imageuploader_" + this.parent.id,
149+
this.config.additional_data.uploaderConfig,
150+
this.parent.id,
151+
this.parent.dataStore,
152+
initialImageValue,
153+
);
143154
return this.uploader;
144155
}
145156

@@ -251,18 +262,6 @@ export default class Preview extends BasePreview {
251262

252263
events.on(`${this.config.name}:mountAfter`, (args: ContentTypeMountEventParamsInterface) => {
253264
if (args.id === this.parent.id) {
254-
const dataStore = this.parent.dataStore.get();
255-
const initialImageValue = dataStore[this.config.additional_data.uploaderConfig.dataScope] || "";
256-
257-
// Create uploader
258-
this.uploader = new Uploader(
259-
"imageuploader_" + this.parent.id,
260-
this.config.additional_data.uploaderConfig,
261-
this.parent.id,
262-
this.parent.dataStore,
263-
initialImageValue,
264-
);
265-
266265
// Update the display label for the slide
267266
const slider = this.parent.parent;
268267
this.displayLabel($t(`Slide ${slider.children().indexOf(this.parent) + 1}`));

0 commit comments

Comments
 (0)