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,
"no-throw-literal": 0,
"no-extra-bind": 0,
"consistent-return": 0,
"no-shadow": 0,
"no-underscore-dangle": 0,
"brace-style": 0,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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