Fix eslint no-unneeded-ternary in ES5

[MAILPOET-1085]
This commit is contained in:
Pavel Dohnal
2017-09-06 09:28:22 +01:00
parent 2c068c7bb6
commit b4092e0641
5 changed files with 4 additions and 5 deletions

View File

@@ -40,7 +40,6 @@
"default-case": 0,
"no-lonely-if": 0,
"space-before-blocks": 0,
"no-unneeded-ternary": 0,
"no-mixed-operators": 0,
"eqeqeq": 0,
"space-in-parens": 0,

View File

@@ -486,7 +486,7 @@ var WysijaForm = {
// get parent dimensions and position
var parentDim = element.up('.mailpoet_form_block').getDimensions(),
parentPos = element.up('.mailpoet_form_block').cumulativeOffset(),
is_visible = (parentPos.top <= (WysijaForm.scroll.top + viewportHeight)) ? true : false,
is_visible = (parentPos.top <= (WysijaForm.scroll.top + viewportHeight)),
buttonMargin = 5,
relativeTop = buttonMargin;

View File

@@ -54,7 +54,7 @@ define([
// Use substitution instead of a clone
var tempClone = (_.isFunction(that.options.onDragSubstituteBy)) ? that.options.onDragSubstituteBy(that) : undefined,
// Or use a clone
clone = tempClone ? tempClone : event.target.cloneNode(true),
clone = tempClone || event.target.cloneNode(true),
$original = jQuery(event.target),
$clone = jQuery(clone),

View File

@@ -275,7 +275,7 @@ define([
this.model.set(field, jQuery(event.target).val() + suffix);
},
changeBoolField: function(field, event) {
this.model.set(field, (jQuery(event.target).val() === 'true') ? true : false);
this.model.set(field, (jQuery(event.target).val() === 'true'));
},
changeBoolCheckboxField: function(field, event) {
this.model.set(field, (!!jQuery(event.target).prop('checked')));

View File

@@ -1020,7 +1020,7 @@ define(
subscribers: subscribers[batchNumber],
timestamp: timestamp,
segments: segmentSelectElement.val(),
updateSubscribers: (jQuery(':radio[name="subscriber_update_option"]:checked').val() === 'yes') ? true : false
updateSubscribers: (jQuery(':radio[name="subscriber_update_option"]:checked').val() === 'yes')
})
}).done(function(response) {
importResults.created += response.data.created;