diff -u b/core/misc/ajax.es6.js b/core/misc/ajax.es6.js --- b/core/misc/ajax.es6.js +++ b/core/misc/ajax.es6.js @@ -814,13 +814,18 @@ /** * An animated progress throbber and container element for AJAX operations. * + * @param {string|null} message + * (optional) The message shown on the UI. + * * @return * The HTML markup for the throbber. */ - Drupal.theme.ajaxProgressThrobber = function(message) { - return '
 
' + - Drupal.theme('ajaxProgressMessage', message) + '
'; - } + Drupal.theme.ajaxProgressThrobber = function (message = null) { + const messageMarkup = message !== null ? Drupal.theme('ajaxProgressMessage', message) : ''; + const throbber = '
 
'; + + return `
${throbber}${messageMarkup}
`; + }; /** * An animated progress throbber and container element for AJAX operations. @@ -828,20 +833,18 @@ * @return * The HTML markup for the throbber. */ - Drupal.theme.ajaxProgressIndicatorFullscreen = function() { + Drupal.theme.ajaxProgressIndicatorFullscreen = function () { return '
 
'; }; /** - * Formats optional text accompanying the AJAX progress throbber. + * Formats text accompanying the AJAX progress throbber. * * @return * The HTML markup for the throbber. */ - Drupal.theme.ajaxProgressMessage = function(message) { - if (message) { - return '
' + message + '
'; - } + Drupal.theme.ajaxProgressMessage = function (message) { + return `
${message}
`; }; /** diff -u b/core/misc/ajax.js b/core/misc/ajax.js --- b/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -368,8 +368,13 @@ } }; - Drupal.theme.ajaxProgressThrobber = function (message) { - return '
 
' + Drupal.theme('ajaxProgressMessage', message) + '
'; + Drupal.theme.ajaxProgressThrobber = function () { + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + + var messageMarkup = message !== null ? Drupal.theme('ajaxProgressMessage', message) : ''; + var throbber = '
 
'; + + return '
' + throbber + messageMarkup + '
'; }; Drupal.theme.ajaxProgressIndicatorFullscreen = function () { @@ -377,9 +382,7 @@ }; Drupal.theme.ajaxProgressMessage = function (message) { - if (message) { - return '
' + message + '
'; - } + return '
' + message + '
'; }; Drupal.Ajax.prototype.setProgressIndicatorBar = function () { only in patch2: unchanged: --- a/core/modules/field_ui/field_ui.es6.js +++ b/core/modules/field_ui/field_ui.es6.js @@ -219,7 +219,7 @@ if (rowNames.length) { // Add a throbber next each of the ajaxElements. - $(ajaxElements).after('
 
'); + $(ajaxElements).after(Drupal.theme.ajaxProgressThrobber()); // Fire the Ajax update. $('input[name=refresh_rows]').val(rowNames.join(' ')); only in patch2: unchanged: --- a/core/modules/field_ui/field_ui.js +++ b/core/modules/field_ui/field_ui.js @@ -126,7 +126,7 @@ }); if (rowNames.length) { - $(ajaxElements).after('
 
'); + $(ajaxElements).after(Drupal.theme.ajaxProgressThrobber()); $('input[name=refresh_rows]').val(rowNames.join(' ')); $('input[data-drupal-selector="edit-refresh"]').trigger('mousedown');