Use styles from woocommerce everytime

[MAILPOET-2279]
This commit is contained in:
Amine Ben hammou
2019-10-03 04:40:01 +01:00
committed by Jack Kitterhing
parent 96cbce78a3
commit 812b89cfee
2 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import App from 'newsletter_editor/App';
import BaseBlock from 'newsletter_editor/blocks/base';
const BlockModel = BaseBlock.BlockModel.extend({
stale: ['styles'],
defaults: function () {
return this._getDefaults({
type: 'woocommerceContent',
@ -41,6 +42,13 @@ const BlockView = BaseBlock.BlockView.extend({
this.toolsView = new BlockToolsView({ model: this.model });
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) {