File tree Expand file tree Collapse file tree 2 files changed +31
-18
lines changed
app/code/Magento/PageBuilder/view/adminhtml/web Expand file tree Collapse file tree 2 files changed +31
-18
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ export default class Preview {
42
42
public placeholderCss : KnockoutObservable < object > ;
43
43
public isPlaceholderVisible : KnockoutObservable < boolean > = ko . observable ( true ) ;
44
44
public isEmpty : KnockoutObservable < boolean > = ko . observable ( true ) ;
45
- public previewTemplate : KnockoutObservable < string > = ko . observable ( ) ;
46
45
47
46
/**
48
47
* @deprecated
@@ -84,11 +83,20 @@ export default class Preview {
84
83
"visible" : this . isEmpty ,
85
84
"empty-placeholder-background" : this . isPlaceholderVisible ,
86
85
} ) ;
87
- this . previewTemplate ( this . getPreviewTemplate ( ) ) ;
88
86
this . setupDataFields ( ) ;
89
87
this . bindEvents ( ) ;
90
88
}
91
89
90
+ /**
91
+ * Retrieve the preview template
92
+ *
93
+ * @returns {string }
94
+ */
95
+ get previewTemplate ( ) : string {
96
+ const appearance = this . previewData . appearance ? this . previewData . appearance ( ) as string : undefined ;
97
+ return appearanceConfig ( this . config . name , appearance ) . preview_template ;
98
+ }
99
+
92
100
/**
93
101
* Calls methods by event name.
94
102
*
@@ -491,12 +499,6 @@ export default class Preview {
491
499
492
500
} ,
493
501
) ;
494
-
495
- // If the appearance of the content type changes, update the preview template
496
- this . parent . dataStore . subscribe ( ( ) => {
497
- this . previewTemplate ( this . getPreviewTemplate ( ) ) ;
498
- } , "appearance" ) ;
499
-
500
502
if ( this . parent instanceof ContentTypeCollection ) {
501
503
this . parent . children . subscribe (
502
504
( children : any [ ] ) => {
You can’t perform that action at this time.
0 commit comments