3 * Defines Javascript behaviors for the media form.
8 * Behaviors for summaries for tabs in the media edit form.
10 * @type {Drupal~behavior}
12 * @prop {Drupal~behaviorAttach} attach
13 * Attaches summary behavior for tabs in the media edit form.
15 Drupal.behaviors.mediaFormSummaries = {
17 const $context = $(context);
19 $context.find('.media-form-author').drupalSetSummary(context => {
20 const $authorContext = $(context);
21 const name = $authorContext.find('.field--name-uid input').val();
22 const date = $authorContext.find('.field--name-created input').val();
25 return Drupal.t('By @name on @date', {
31 return Drupal.t('By @name', { '@name': name });
34 return Drupal.t('Authored on @date', { '@date': date });