ES5 space-before-function-parens
This commit is contained in:
@@ -6,7 +6,7 @@ define([
|
||||
'newsletter_editor/blocks/base',
|
||||
'underscore',
|
||||
'mailpoet'
|
||||
], function(App, BaseBlock, _, MailPoet) {
|
||||
], function (App, BaseBlock, _, MailPoet) {
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -14,7 +14,7 @@ define([
|
||||
base = BaseBlock;
|
||||
|
||||
Module.TextBlockModel = base.BlockModel.extend({
|
||||
defaults: function() {
|
||||
defaults: function () {
|
||||
return this._getDefaults({
|
||||
type: 'text',
|
||||
text: 'Edit this to insert text'
|
||||
@@ -24,7 +24,7 @@ define([
|
||||
|
||||
Module.TextBlockView = base.BlockView.extend({
|
||||
className: 'mailpoet_block mailpoet_text_block mailpoet_droppable_block',
|
||||
getTemplate: function() { return window.templates.textBlock; },
|
||||
getTemplate: function () { return window.templates.textBlock; },
|
||||
modelEvents: _.omit(base.BlockView.prototype.modelEvents, 'change'), // Prevent rerendering on model change due to text editor redrawing
|
||||
behaviors: _.extend({}, base.BlockView.prototype.behaviors, {
|
||||
TextEditorBehavior: {
|
||||
@@ -34,7 +34,7 @@ define([
|
||||
invalidElements: 'script',
|
||||
blockFormats: 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Paragraph=p',
|
||||
plugins: 'link lists code textcolor colorpicker mailpoet_shortcodes paste',
|
||||
configurationFilter: function(originalSettings) {
|
||||
configurationFilter: function (originalSettings) {
|
||||
return _.extend({}, originalSettings, {
|
||||
mailpoet_shortcodes: App.getConfig().get('shortcodes').toJSON(),
|
||||
mailpoet_shortcodes_window_title: MailPoet.I18n.t('shortcodesWindowTitle')
|
||||
@@ -42,7 +42,7 @@ define([
|
||||
}
|
||||
}
|
||||
}),
|
||||
initialize: function(options) {
|
||||
initialize: function (options) {
|
||||
base.BlockView.prototype.initialize.apply(this, arguments);
|
||||
|
||||
this.renderOptions = _.defaults(options.renderOptions || {}, {
|
||||
@@ -51,8 +51,8 @@ define([
|
||||
|
||||
this.disableTextEditor = this.renderOptions.disableTextEditor;
|
||||
},
|
||||
onDragSubstituteBy: function() { return Module.TextWidgetView; },
|
||||
onRender: function() {
|
||||
onDragSubstituteBy: function () { return Module.TextWidgetView; },
|
||||
onRender: function () {
|
||||
this.toolsView = new Module.TextBlockToolsView({
|
||||
model: this.model,
|
||||
tools: {
|
||||
@@ -61,40 +61,40 @@ define([
|
||||
});
|
||||
this.showChildView('toolsRegion', this.toolsView);
|
||||
},
|
||||
onTextEditorChange: function(newContent) {
|
||||
onTextEditorChange: function (newContent) {
|
||||
this.model.set('text', newContent);
|
||||
},
|
||||
onTextEditorFocus: function() {
|
||||
onTextEditorFocus: function () {
|
||||
this.disableDragging();
|
||||
this.disableShowingTools();
|
||||
},
|
||||
onTextEditorBlur: function() {
|
||||
onTextEditorBlur: function () {
|
||||
this.enableDragging();
|
||||
this.enableShowingTools();
|
||||
}
|
||||
});
|
||||
|
||||
Module.TextBlockToolsView = base.BlockToolsView.extend({
|
||||
getSettingsView: function() { return Module.TextBlockSettingsView; }
|
||||
getSettingsView: function () { return Module.TextBlockSettingsView; }
|
||||
});
|
||||
|
||||
Module.TextBlockSettingsView = base.BlockSettingsView.extend({
|
||||
getTemplate: function() { return window.templates.textBlockSettings; }
|
||||
getTemplate: function () { return window.templates.textBlockSettings; }
|
||||
});
|
||||
|
||||
Module.TextWidgetView = base.WidgetView.extend({
|
||||
getTemplate: function() { return window.templates.textInsertion; },
|
||||
getTemplate: function () { return window.templates.textInsertion; },
|
||||
behaviors: {
|
||||
DraggableBehavior: {
|
||||
cloneOriginal: true,
|
||||
drop: function() {
|
||||
drop: function () {
|
||||
return new Module.TextBlockModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
App.on('before:start', function(App, options) {
|
||||
App.on('before:start', function (App, options) {
|
||||
App.registerBlockType('text', {
|
||||
blockModel: Module.TextBlockModel,
|
||||
blockView: Module.TextBlockView
|
||||
|
Reference in New Issue
Block a user