X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmedia%2Fjs%2Ftype_form.es6.js;fp=web%2Fcore%2Fmodules%2Fmedia%2Fjs%2Ftype_form.es6.js;h=5c3cc90cb6856faee07426991aa29ea8eb45fbbb;hp=4c664a3ded98960fa42a00e082c29eb624f24a08;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/media/js/type_form.es6.js b/web/core/modules/media/js/type_form.es6.js index 4c664a3de..5c3cc90cb 100644 --- a/web/core/modules/media/js/type_form.es6.js +++ b/web/core/modules/media/js/type_form.es6.js @@ -3,7 +3,7 @@ * Defines JavaScript behaviors for the media type form. */ -(function ($, Drupal) { +(function($, Drupal) { /** * Behaviors for setting summaries on media type form. * @@ -16,27 +16,51 @@ attach(context) { const $context = $(context); // Provide the vertical tab summaries. - $context.find('#edit-workflow').drupalSetSummary((context) => { + $context.find('#edit-workflow').drupalSetSummary(context => { const vals = []; - $(context).find('input[name^="options"]:checked').parent().each(function () { - vals.push(Drupal.checkPlain($(this).find('label').text())); - }); - if (!$(context).find('#edit-options-status').is(':checked')) { + $(context) + .find('input[name^="options"]:checked') + .parent() + .each(function() { + vals.push( + Drupal.checkPlain( + $(this) + .find('label') + .text(), + ), + ); + }); + if ( + !$(context) + .find('#edit-options-status') + .is(':checked') + ) { vals.unshift(Drupal.t('Not published')); } return vals.join(', '); }); - $(context).find('#edit-language').drupalSetSummary((context) => { - const vals = []; + $(context) + .find('#edit-language') + .drupalSetSummary(context => { + const vals = []; - vals.push($(context).find('.js-form-item-language-configuration-langcode select option:selected').text()); + vals.push( + $(context) + .find( + '.js-form-item-language-configuration-langcode select option:selected', + ) + .text(), + ); - $(context).find('input:checked').next('label').each(function () { - vals.push(Drupal.checkPlain($(this).text())); - }); + $(context) + .find('input:checked') + .next('label') + .each(function() { + vals.push(Drupal.checkPlain($(this).text())); + }); - return vals.join(', '); - }); + return vals.join(', '); + }); }, }; -}(jQuery, Drupal)); +})(jQuery, Drupal);