Fix ESLint errors

[MAILPOET-2279]
This commit is contained in:
Amine Ben hammou
2019-10-04 04:07:50 +01:00
committed by Jack Kitterhing
parent 139e40bf51
commit 730866d69c

View File

@@ -1,10 +1,9 @@
/* eslint-disable func-names */
import App from 'newsletter_editor/App'; 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'], stale: ['styles'],
defaults: function () { defaults() {
return this._getDefaults({ return this._getDefaults({
type: 'woocommerceContent', type: 'woocommerceContent',
styles: { styles: {
@@ -20,11 +19,11 @@ const BlockToolsView = BaseBlock.BlockToolsView.extend({
const WidgetView = BaseBlock.WidgetView.extend({ const WidgetView = BaseBlock.WidgetView.extend({
className: BaseBlock.WidgetView.prototype.className + ' mailpoet_droppable_layout_block', className: BaseBlock.WidgetView.prototype.className + ' mailpoet_droppable_layout_block',
getTemplate: function () { return window.templates.woocommerceContentInsertion; }, getTemplate() { return window.templates.woocommerceContentInsertion; },
behaviors: { behaviors: {
DraggableBehavior: { DraggableBehavior: {
cloneOriginal: true, cloneOriginal: true,
drop: function () { drop() {
return new BlockModel({}, { parse: true }); return new BlockModel({}, { parse: true });
}, },
}, },
@@ -33,16 +32,16 @@ const WidgetView = BaseBlock.WidgetView.extend({
const BlockView = BaseBlock.BlockView.extend({ const BlockView = BaseBlock.BlockView.extend({
className: 'mailpoet_block mailpoet_woocommerce_content_block mailpoet_droppable_block', className: 'mailpoet_block mailpoet_woocommerce_content_block mailpoet_droppable_block',
getTemplate: function () { return window.templates.woocommerceContentBlock; }, getTemplate() { return window.templates.woocommerceContentBlock; },
regions: { regions: {
toolsRegion: '.mailpoet_tools', toolsRegion: '.mailpoet_tools',
}, },
onDragSubstituteBy: function () { return WidgetView; }, onDragSubstituteBy() { return WidgetView; },
onRender: function () { onRender() {
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() { templateContext() {
return { return {
viewCid: this.cid, viewCid: this.cid,
model: this.model.toJSON(), model: this.model.toJSON(),
@@ -51,7 +50,7 @@ const BlockView = BaseBlock.BlockView.extend({
}, },
}); });
App.on('before:start', function (BeforeStartApp) { App.on('before:start', (BeforeStartApp) => {
BeforeStartApp.registerBlockType('woocommerceContent', { BeforeStartApp.registerBlockType('woocommerceContent', {
blockModel: BlockModel, blockModel: BlockModel,
blockView: BlockView, blockView: BlockView,