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 BaseBlock from 'newsletter_editor/blocks/base';
const BlockModel = BaseBlock.BlockModel.extend({
stale: ['styles'],
defaults: function () {
defaults() {
return this._getDefaults({
type: 'woocommerceContent',
styles: {
@@ -20,11 +19,11 @@ const BlockToolsView = BaseBlock.BlockToolsView.extend({
const WidgetView = BaseBlock.WidgetView.extend({
className: BaseBlock.WidgetView.prototype.className + ' mailpoet_droppable_layout_block',
getTemplate: function () { return window.templates.woocommerceContentInsertion; },
getTemplate() { return window.templates.woocommerceContentInsertion; },
behaviors: {
DraggableBehavior: {
cloneOriginal: true,
drop: function () {
drop() {
return new BlockModel({}, { parse: true });
},
},
@@ -33,16 +32,16 @@ const WidgetView = BaseBlock.WidgetView.extend({
const BlockView = BaseBlock.BlockView.extend({
className: 'mailpoet_block mailpoet_woocommerce_content_block mailpoet_droppable_block',
getTemplate: function () { return window.templates.woocommerceContentBlock; },
getTemplate() { return window.templates.woocommerceContentBlock; },
regions: {
toolsRegion: '.mailpoet_tools',
},
onDragSubstituteBy: function () { return WidgetView; },
onRender: function () {
onDragSubstituteBy() { return WidgetView; },
onRender() {
this.toolsView = new BlockToolsView({ model: this.model });
this.showChildView('toolsRegion', this.toolsView);
},
templateContext: function templateContext() {
templateContext() {
return {
viewCid: this.cid,
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', {
blockModel: BlockModel,
blockView: BlockView,