path.es6.js 668 B

123456789101112131415161718192021222324252627
  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)
  17. .find('.path-form')
  18. .drupalSetSummary(context => {
  19. const path = $('.js-form-item-path-0-alias input').val();
  20. return path
  21. ? Drupal.t('Alias: @alias', { '@alias': path })
  22. : Drupal.t('No alias');
  23. });
  24. },
  25. };
  26. })(jQuery, Drupal);