path.js 674 B

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