Commit 77424918 authored by larowlan's avatar larowlan Committed by alexpott

Issue #3091672 by alexpott: Fix javascript coding standards

(cherry picked from commit 0a69c9c5)
(cherry picked from commit 98e3cac2)
parent 18351b7e
...@@ -231,9 +231,7 @@ ...@@ -231,9 +231,7 @@
* A string representing a DOM fragment. * A string representing a DOM fragment.
*/ */
dropbuttonToggle(options) { dropbuttonToggle(options) {
return `<li class="dropbutton-toggle"><button type="button"><span class="dropbutton-arrow"><span class="visually-hidden">${ return `<li class="dropbutton-toggle"><button type="button"><span class="dropbutton-arrow"><span class="visually-hidden">${options.title}</span></span></button></li>`;
options.title
}</span></span></button></li>`;
}, },
}, },
); );
......
...@@ -56,11 +56,10 @@ ...@@ -56,11 +56,10 @@
// Attach summary for configurable filters (only for screen readers). // Attach summary for configurable filters (only for screen readers).
if (filterSettingsTab) { if (filterSettingsTab) {
filterSettingsTab.details.drupalSetSummary( filterSettingsTab.details.drupalSetSummary(() =>
() => $checkbox.is(':checked')
$checkbox.is(':checked') ? Drupal.t('Enabled')
? Drupal.t('Enabled') : Drupal.t('Disabled'),
: Drupal.t('Disabled'),
); );
} }
......
...@@ -34,9 +34,7 @@ ...@@ -34,9 +34,7 @@
*/ */
Drupal.theme.quickeditEntityToolbar = function(settings) { Drupal.theme.quickeditEntityToolbar = function(settings) {
let html = ''; let html = '';
html += `<div id="${ html += `<div id="${settings.id}" class="quickedit quickedit-toolbar-container clearfix">`;
settings.id
}" class="quickedit quickedit-toolbar-container clearfix">`;
html += '<i class="quickedit-toolbar-pointer"></i>'; html += '<i class="quickedit-toolbar-pointer"></i>';
html += '<div class="quickedit-toolbar-content">'; html += '<div class="quickedit-toolbar-content">';
html += html +=
......
...@@ -38,9 +38,8 @@ ...@@ -38,9 +38,8 @@
*/ */
function dateFormatHandler(e) { function dateFormatHandler(e) {
const baseValue = $(e.target).val() || ''; const baseValue = $(e.target).val() || '';
const dateString = baseValue.replace( const dateString = baseValue.replace(/\\?(.?)/gi, (key, value) =>
/\\?(.?)/gi, dateFormats[key] ? dateFormats[key] : value,
(key, value) => (dateFormats[key] ? dateFormats[key] : value),
); );
$preview.text(dateString); $preview.text(dateString);
......
...@@ -197,8 +197,6 @@ ...@@ -197,8 +197,6 @@
* A string representing a DOM fragment. * A string representing a DOM fragment.
*/ */
Drupal.theme.toolbarMenuItemToggle = function(options) { Drupal.theme.toolbarMenuItemToggle = function(options) {
return `<button class="${options.class}"><span class="action">${ return `<button class="${options.class}"><span class="action">${options.action}</span> <span class="label">${options.text}</span></button>`;
options.action
}</span> <span class="label">${options.text}</span></button>`;
}; };
})(jQuery, Drupal, drupalSettings); })(jQuery, Drupal, drupalSettings);
...@@ -47,9 +47,7 @@ ...@@ -47,9 +47,7 @@
// If the password strength indicator is enabled, add its markup. // If the password strength indicator is enabled, add its markup.
if (settings.password.showStrengthIndicator) { 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">${ 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>`;
translate.strengthTitle
} <span class="password-strength__text js-password-strength__text"></span></div></div>`;
$confirmInput $confirmInput
.parent() .parent()
.after('<div class="password-suggestions description"></div>'); .after('<div class="password-suggestions description"></div>');
......
...@@ -11,7 +11,5 @@ ...@@ -11,7 +11,5 @@
* A string representing a DOM fragment. * A string representing a DOM fragment.
*/ */
Drupal.theme.passwordConfirmMessage = translate => Drupal.theme.passwordConfirmMessage = translate =>
`<div aria-live="polite" aria-atomic="true" class="password-confirm-message js-password-confirm-message">${ `<div aria-live="polite" aria-atomic="true" class="password-confirm-message js-password-confirm-message">${translate.confirmTitle} <span></span></div>`;
translate.confirmTitle
} <span></span></div>`;
})(Drupal); })(Drupal);
...@@ -11,7 +11,5 @@ ...@@ -11,7 +11,5 @@
* A string representing a DOM fragment. * A string representing a DOM fragment.
*/ */
Drupal.theme.passwordConfirmMessage = translate => Drupal.theme.passwordConfirmMessage = translate =>
`<div aria-live="polite" aria-atomic="true" class="password-confirm js-password-confirm js-password-confirm-message">${ `<div aria-live="polite" aria-atomic="true" class="password-confirm js-password-confirm js-password-confirm-message">${translate.confirmTitle} <span></span></div>`;
translate.confirmTitle
} <span></span></div>`;
})(Drupal); })(Drupal);
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