Fix eslint no-mixed-operators in es5 files

[MAILPOET-1145]
This commit is contained in:
Pavel Dohnal
2018-02-19 15:51:01 +00:00
parent 0ff9c006d8
commit 704e4e40f7
5 changed files with 7 additions and 7 deletions

View File

@@ -34,7 +34,6 @@
"no-plusplus": 0,
"default-case": 0,
"no-lonely-if": 0,
"no-mixed-operators": 0,
"brace-style": 0,
"space-infix-ops": 0
}

View File

@@ -61,7 +61,7 @@ define('mp2migrator', ['mailpoet', 'jquery'], function (mp, jQuery) {
// Move the progress bar
var progress = 0;
if ((result.total !== undefined) && (Number(result.total) !== 0)) {
progress = Math.round(Number(result.current) / Number(result.total) * 100);
progress = Math.round((Number(result.current) / Number(result.total)) * 100);
}
jQuery('#progressbar').progressbar('option', 'value', progress);
jQuery('#progresslabel').html(progress + '%');

View File

@@ -418,7 +418,7 @@ define([
elementDimension = element.outerWidth(true);
}
if (eventOffset <= closeOffset + elementDimension / 2) {
if (eventOffset <= closeOffset + (elementDimension / 2)) {
// First half of the element
return {
index: index,

View File

@@ -61,7 +61,7 @@ define([
},
templateContext: function templateContext() {
return _.extend({
totalHeight: parseInt(this.model.get('styles.block.padding'), 10) * 2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px'
totalHeight: (parseInt(this.model.get('styles.block.padding'), 10) * 2) + parseInt(this.model.get('styles.block.borderWidth')) + 'px'
}, base.BlockView.prototype.templateContext.apply(this));
},
onRender: function onRender() {
@@ -75,7 +75,7 @@ define([
changePadding: function changePadding() {
this.$('.mailpoet_content').css('padding-top', this.model.get('styles.block.padding'));
this.$('.mailpoet_content').css('padding-bottom', this.model.get('styles.block.padding'));
this.$('.mailpoet_resize_handle_text').text(parseInt(this.model.get('styles.block.padding'), 10) * 2 + parseInt(this.model.get('styles.block.borderWidth')) + 'px');
this.$('.mailpoet_resize_handle_text').text((parseInt(this.model.get('styles.block.padding'), 10) * 2) + parseInt(this.model.get('styles.block.borderWidth')) + 'px');
}
});

View File

@@ -246,8 +246,9 @@ define(
processedSubscribers = _.values(processedSubscribers);
// if the header options is set, there should be at least
// 2 data rows, otherwise at least 1 data row
if (processedSubscribers &&
(isHeaderFound && processedSubscribers.length >= 2) ||
if (
(processedSubscribers && (isHeaderFound && processedSubscribers.length >= 2))
||
(!isHeaderFound && processedSubscribers.length >= 1)
) {
// since we assume that the header line is always present, we need