Skip to content

Commit ebdbfda

Browse files
PB-166: Page Builder doesn't implement destroy method
1 parent 23ec764 commit ebdbfda

File tree

2 files changed

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

2 files changed

+14
-8
lines changed

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

Lines changed: 7 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/slider/preview.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,9 @@ export default class Preview extends PreviewCollection {
340340
*/
341341
public destroy(): void {
342342
super.destroy();
343-
this.setFocusedSlide(null);
344-
this.focusedSlideSubscriber.dispose();
343+
if (this.focusedSlideSubscriber) {
344+
this.focusedSlideSubscriber.dispose();
345+
}
345346
}
346347

347348
/**
@@ -559,8 +560,10 @@ export default class Preview extends PreviewCollection {
559560
*/
560561
private onColumnResize(params: any) {
561562
setTimeout(() => {
562-
$(this.element).slick("setPosition");
563-
this.checkWidth();
563+
if (this.element) {
564+
$(this.element).slick("setPosition");
565+
this.checkWidth();
566+
}
564567
}, 250);
565568
}
566569

0 commit comments

Comments
 (0)