Issue #3091672 by alexpott: Fix javascript coding standards

(cherry picked from commit 0a69c9c580)
merge-requests/64/head
Lee Rowlands 2019-11-01 15:39:25 +10:00
parent 0712474d54
commit 98e3cac2a9
No known key found for this signature in database
GPG Key ID: 2B829A3DF9204DC4
8 changed files with 12 additions and 26 deletions

View File

@ -231,9 +231,7 @@
* A string representing a DOM fragment.
*/
dropbuttonToggle(options) {
return `<li class="dropbutton-toggle"><button type="button"><span class="dropbutton-arrow"><span class="visually-hidden">${
options.title
}</span></span></button></li>`;
return `<li class="dropbutton-toggle"><button type="button"><span class="dropbutton-arrow"><span class="visually-hidden">${options.title}</span></span></button></li>`;
},
},
);

View File

@ -56,11 +56,10 @@
// Attach summary for configurable filters (only for screen readers).
if (filterSettingsTab) {
filterSettingsTab.details.drupalSetSummary(
() =>
$checkbox.is(':checked')
? Drupal.t('Enabled')
: Drupal.t('Disabled'),
filterSettingsTab.details.drupalSetSummary(() =>
$checkbox.is(':checked')
? Drupal.t('Enabled')
: Drupal.t('Disabled'),
);
}

View File

@ -34,9 +34,7 @@
*/
Drupal.theme.quickeditEntityToolbar = function(settings) {
let html = '';
html += `<div id="${
settings.id
}" class="quickedit quickedit-toolbar-container clearfix">`;
html += `<div id="${settings.id}" class="quickedit quickedit-toolbar-container clearfix">`;
html += '<i class="quickedit-toolbar-pointer"></i>';
html += '<div class="quickedit-toolbar-content">';
html +=

View File

@ -38,9 +38,8 @@
*/
function dateFormatHandler(e) {
const baseValue = $(e.target).val() || '';
const dateString = baseValue.replace(
/\\?(.?)/gi,
(key, value) => (dateFormats[key] ? dateFormats[key] : value),
const dateString = baseValue.replace(/\\?(.?)/gi, (key, value) =>
dateFormats[key] ? dateFormats[key] : value,
);
$preview.text(dateString);

View File

@ -197,8 +197,6 @@
* A string representing a DOM fragment.
*/
Drupal.theme.toolbarMenuItemToggle = function(options) {
return `<button class="${options.class}"><span class="action">${
options.action
}</span> <span class="label">${options.text}</span></button>`;
return `<button class="${options.class}"><span class="action">${options.action}</span> <span class="label">${options.text}</span></button>`;
};
})(jQuery, Drupal, drupalSettings);

View File

@ -47,9 +47,7 @@
// If the password strength indicator is enabled, add its markup.
if (settings.password.showStrengthIndicator) {
const passwordMeter = `<div class="password-strength"><div class="password-strength__meter"><div class="password-strength__indicator js-password-strength__indicator"></div></div><div aria-live="polite" aria-atomic="true" class="password-strength__title">${
translate.strengthTitle
} <span class="password-strength__text js-password-strength__text"></span></div></div>`;
const passwordMeter = `<div class="password-strength"><div class="password-strength__meter"><div class="password-strength__indicator js-password-strength__indicator"></div></div><div aria-live="polite" aria-atomic="true" class="password-strength__title">${translate.strengthTitle} <span class="password-strength__text js-password-strength__text"></span></div></div>`;
$confirmInput
.parent()
.after('<div class="password-suggestions description"></div>');

View File

@ -11,7 +11,5 @@
* A string representing a DOM fragment.
*/
Drupal.theme.passwordConfirmMessage = translate =>
`<div aria-live="polite" aria-atomic="true" class="password-confirm-message js-password-confirm-message">${
translate.confirmTitle
} <span></span></div>`;
`<div aria-live="polite" aria-atomic="true" class="password-confirm-message js-password-confirm-message">${translate.confirmTitle} <span></span></div>`;
})(Drupal);

View File

@ -11,7 +11,5 @@
* A string representing a DOM fragment.
*/
Drupal.theme.passwordConfirmMessage = translate =>
`<div aria-live="polite" aria-atomic="true" class="password-confirm js-password-confirm js-password-confirm-message">${
translate.confirmTitle
} <span></span></div>`;
`<div aria-live="polite" aria-atomic="true" class="password-confirm js-password-confirm js-password-confirm-message">${translate.confirmTitle} <span></span></div>`;
})(Drupal);