Commit fa985778 authored by alexpott's avatar alexpott

Issue #2914717 by droplet: JS codestyle: array-callback-return

parent 0b1741f7
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"max-len": "off", "max-len": "off",
"default-case": "off", "default-case": "off",
"camelcase": "off", "camelcase": "off",
"array-callback-return": "off",
"vars-on-top": "off", "vars-on-top": "off",
"prefer-rest-params": "off", "prefer-rest-params": "off",
"prefer-const": "off" "prefer-const": "off"
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
const userInfo = ['name', 'mail', 'homepage']; const userInfo = ['name', 'mail', 'homepage'];
const $forms = $('[data-user-info-from-browser]').once('user-info-from-browser'); const $forms = $('[data-user-info-from-browser]').once('user-info-from-browser');
if ($forms.length) { if ($forms.length) {
userInfo.map((info) => { userInfo.forEach((info) => {
const $element = $forms.find(`[name=${info}]`); const $element = $forms.find(`[name=${info}]`);
const browserData = localStorage.getItem(`Drupal.visitor.${info}`); const browserData = localStorage.getItem(`Drupal.visitor.${info}`);
const emptyOrDefault = ($element.val() === '' || ($element.attr('data-drupal-default-value') === $element.val())); const emptyOrDefault = ($element.val() === '' || ($element.attr('data-drupal-default-value') === $element.val()));
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
}); });
} }
$forms.on('submit', () => { $forms.on('submit', () => {
userInfo.map((info) => { userInfo.forEach((info) => {
const $element = $forms.find(`[name=${info}]`); const $element = $forms.find(`[name=${info}]`);
if ($element.length) { if ($element.length) {
localStorage.setItem(`Drupal.visitor.${info}`, $element.val()); localStorage.setItem(`Drupal.visitor.${info}`, $element.val());
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
var userInfo = ['name', 'mail', 'homepage']; var userInfo = ['name', 'mail', 'homepage'];
var $forms = $('[data-user-info-from-browser]').once('user-info-from-browser'); var $forms = $('[data-user-info-from-browser]').once('user-info-from-browser');
if ($forms.length) { if ($forms.length) {
userInfo.map(function (info) { userInfo.forEach(function (info) {
var $element = $forms.find('[name=' + info + ']'); var $element = $forms.find('[name=' + info + ']');
var browserData = localStorage.getItem('Drupal.visitor.' + info); var browserData = localStorage.getItem('Drupal.visitor.' + info);
var emptyOrDefault = $element.val() === '' || $element.attr('data-drupal-default-value') === $element.val(); var emptyOrDefault = $element.val() === '' || $element.attr('data-drupal-default-value') === $element.val();
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
}); });
} }
$forms.on('submit', function () { $forms.on('submit', function () {
userInfo.map(function (info) { userInfo.forEach(function (info) {
var $element = $forms.find('[name=' + info + ']'); var $element = $forms.find('[name=' + info + ']');
if ($element.length) { if ($element.length) {
localStorage.setItem('Drupal.visitor.' + info, $element.val()); localStorage.setItem('Drupal.visitor.' + info, $element.val());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment