Fix consistent-return eslint rule in ES5 files

[MAILPOET-1144]
This commit is contained in:
Pavel Dohnal
2017-11-29 13:43:35 +00:00
parent dee2ff810c
commit ea552508b4
11 changed files with 15 additions and 7 deletions

View File

@ -37,7 +37,6 @@
"global-require": 0, "global-require": 0,
"no-throw-literal": 0, "no-throw-literal": 0,
"no-extra-bind": 0, "no-extra-bind": 0,
"consistent-return": 0,
"no-shadow": 0, "no-shadow": 0,
"no-underscore-dangle": 0, "no-underscore-dangle": 0,
"brace-style": 0, "brace-style": 0,

View File

@ -330,6 +330,7 @@ WysijaForm = {
setting.setValue(data.settings[setting.name]); setting.setValue(data.settings[setting.name]);
} }
} }
return true;
}); });
} }
}, },
@ -582,10 +583,8 @@ WysijaForm = {
}, },
hideControls: function () { hideControls: function () {
try { try {
return WysijaForm.getBlocks().invoke('hideControls'); WysijaForm.getBlocks().invoke('hideControls');
} catch (e) { } catch (e) {}
return;
}
}, },
hideTools: function () { hideTools: function () {
window.$$('.wysija_tools').invoke('hide'); window.$$('.wysija_tools').invoke('hide');
@ -657,6 +656,7 @@ WysijaForm = {
// this is a url, so do not encode the protocol // this is a url, so do not encode the protocol
return encodeURI(str).replace(/[!'()*]/g, escape); return encodeURI(str).replace(/[!'()*]/g, escape);
} }
return str;
}, },
updateBlock: function (field) { updateBlock: function (field) {
var hasUpdated = false; var hasUpdated = false;
@ -973,6 +973,7 @@ WysijaForm.Block.create = function (createBlock, target) {
// position settings // position settings
WysijaForm.setSettingsPosition(); WysijaForm.setSettingsPosition();
return true;
}; };
document.observe('wjfe:item:drop', function (event) { document.observe('wjfe:item:drop', function (event) {

View File

@ -17,7 +17,7 @@ define('handlebars_helpers', ['handlebars'], function (Handlebars) {
var f; var f;
if (window.moment) { if (window.moment) {
if (timestamp === undefined || isNaN(timestamp) || timestamp <= 0) { if (timestamp === undefined || isNaN(timestamp) || timestamp <= 0) {
return; return undefined;
} }
// set date format // set date format

View File

@ -215,6 +215,7 @@ define('modal', ['mailpoet', 'jquery'],
jQuery(document).on('keyup.mailpoet_modal', function (e) { jQuery(document).on('keyup.mailpoet_modal', function (e) {
if (this.opened === false) { return false; } if (this.opened === false) { return false; }
if (e.keyCode === 27) { this.cancel(); } if (e.keyCode === 27) { this.cancel(); }
return true;
}.bind(this)); }.bind(this));
// make sure the popup is repositioned when the window is resized // make sure the popup is repositioned when the window is resized

View File

@ -358,7 +358,7 @@ define([
if (orientation === 'horizontal' && insertionType === 'special') { if (orientation === 'horizontal' && insertionType === 'special') {
// Disable special insertion for horizontal containers // Disable special insertion for horizontal containers
return; return undefined;
} }
return { return {

View File

@ -79,6 +79,7 @@ define([
WidgetView.destroy(); WidgetView.destroy();
return node; return node;
} }
return undefined;
} }
}, },
HighlightEditingBehavior: {} HighlightEditingBehavior: {}

View File

@ -54,6 +54,7 @@ define([
if (invalidBlock) { if (invalidBlock) {
return invalidBlock.validationError; return invalidBlock.validationError;
} }
return undefined;
}, },
parse: function (response) { parse: function (response) {
// If container has any blocks - add them to a collection // If container has any blocks - add them to a collection
@ -132,6 +133,7 @@ define([
WidgetView.destroy(); WidgetView.destroy();
return node; return node;
} }
return undefined;
}, },
testAttachToInstance: function (model, view) { testAttachToInstance: function (model, view) {
// Attach Draggable only to layout containers and disable it // Attach Draggable only to layout containers and disable it

View File

@ -143,6 +143,7 @@ define([
}).always(function () { }).always(function () {
that.trigger('morePostsLoaded'); that.trigger('morePostsLoaded');
}); });
return true;
}, },
_refreshTransformedPosts: function () { _refreshTransformedPosts: function () {
var that = this; var that = this;

View File

@ -195,6 +195,7 @@ define([
} else { } else {
return this.changeField('link', event); return this.changeField('link', event);
} }
return undefined;
}, },
changeField: function (field, event) { changeField: function (field, event) {
this.model.set(field, jQuery(event.target).val()); this.model.set(field, jQuery(event.target).val());

View File

@ -350,6 +350,7 @@ define([
return message; return message;
} }
return undefined;
}; };
App.on('before:start', function (App) { App.on('before:start', function (App) {

View File

@ -339,6 +339,7 @@ define([
} }
}); });
}); });
return undefined;
} }
}); });