Use styles from woocommerce everytime
[MAILPOET-2279]
This commit is contained in:
committed by
Jack Kitterhing
parent
96cbce78a3
commit
812b89cfee
@ -3,6 +3,7 @@ import App from 'newsletter_editor/App';
|
|||||||
import BaseBlock from 'newsletter_editor/blocks/base';
|
import BaseBlock from 'newsletter_editor/blocks/base';
|
||||||
|
|
||||||
const BlockModel = BaseBlock.BlockModel.extend({
|
const BlockModel = BaseBlock.BlockModel.extend({
|
||||||
|
stale: ['styles'],
|
||||||
defaults: function () {
|
defaults: function () {
|
||||||
return this._getDefaults({
|
return this._getDefaults({
|
||||||
type: 'woocommerceContent',
|
type: 'woocommerceContent',
|
||||||
@ -41,6 +42,13 @@ const BlockView = BaseBlock.BlockView.extend({
|
|||||||
this.toolsView = new BlockToolsView({ model: this.model });
|
this.toolsView = new BlockToolsView({ model: this.model });
|
||||||
this.showChildView('toolsRegion', this.toolsView);
|
this.showChildView('toolsRegion', this.toolsView);
|
||||||
},
|
},
|
||||||
|
templateContext: function templateContext() {
|
||||||
|
return {
|
||||||
|
viewCid: this.cid,
|
||||||
|
model: this.model.toJSON(),
|
||||||
|
styles: this.model.get('styles').toJSON(),
|
||||||
|
};
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
App.on('before:start', function (BeforeStartApp) {
|
App.on('before:start', function (BeforeStartApp) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
.mailpoet_editor_view_{{ viewCid }} .mailpoet_content h1,
|
.mailpoet_editor_view_{{ viewCid }} .mailpoet_content h1,
|
||||||
.mailpoet_editor_view_{{ viewCid }} .mailpoet_content h2,
|
.mailpoet_editor_view_{{ viewCid }} .mailpoet_content h2,
|
||||||
.mailpoet_editor_view_{{ viewCid }} .mailpoet_content h3 {
|
.mailpoet_editor_view_{{ viewCid }} .mailpoet_content h3 {
|
||||||
color: {{ model.styles.titleColor }};
|
color: {{ styles.titleColor }};
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="mailpoet_content mailpoet_woocommerce_content" data-automation-id="woocommerce_content">
|
<div class="mailpoet_content mailpoet_woocommerce_content" data-automation-id="woocommerce_content">
|
||||||
|
Reference in New Issue
Block a user