97ea9f4d82f9552706edefebd08aace977c618e3
[yaffs-website] / web / core / modules / path / path.es6.js
1 /**
2  * @file
3  * Attaches behaviors for the Path module.
4  */
5 (function ($, Drupal) {
6   /**
7    * Behaviors for settings summaries on path edit forms.
8    *
9    * @type {Drupal~behavior}
10    *
11    * @prop {Drupal~behaviorAttach} attach
12    *   Attaches summary behavior on path edit forms.
13    */
14   Drupal.behaviors.pathDetailsSummaries = {
15     attach(context) {
16       $(context).find('.path-form').drupalSetSummary((context) => {
17         const path = $('.js-form-item-path-0-alias input').val();
18
19         return path ?
20           Drupal.t('Alias: @alias', { '@alias': path }) :
21           Drupal.t('No alias');
22       });
23     },
24   };
25 }(jQuery, Drupal));