summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/path/path.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/path/path.js')
-rw-r--r--core/modules/path/path.js40
1 files changed, 24 insertions, 16 deletions
diff --git a/core/modules/path/path.js b/core/modules/path/path.js
index b02e559a676..9d55741b78d 100644
--- a/core/modules/path/path.js
+++ b/core/modules/path/path.js
@@ -1,21 +1,29 @@
/**
-* DO NOT EDIT THIS FILE.
-* See the following change record for more information,
-* https://www.drupal.org/node/2815083
-* @preserve
-**/
-
+ * @file
+ * Attaches behaviors for the Path module.
+ */
(function ($, Drupal) {
+ /**
+ * Behaviors for settings summaries on path edit forms.
+ *
+ * @type {Drupal~behavior}
+ *
+ * @prop {Drupal~behaviorAttach} attach
+ * Attaches summary behavior on path edit forms.
+ */
Drupal.behaviors.pathDetailsSummaries = {
attach(context) {
- $(context).find('.path-form').drupalSetSummary(context => {
- const pathElement = document.querySelector('.js-form-item-path-0-alias input');
- const path = pathElement && pathElement.value;
- return path ? Drupal.t('Alias: @alias', {
- '@alias': path
- }) : Drupal.t('No alias');
- });
- }
-
+ $(context)
+ .find('.path-form')
+ .drupalSetSummary((context) => {
+ const pathElement = document.querySelector(
+ '.js-form-item-path-0-alias input',
+ );
+ const path = pathElement && pathElement.value;
+ return path
+ ? Drupal.t('Alias: @alias', { '@alias': path })
+ : Drupal.t('No alias');
+ });
+ },
};
-})(jQuery, Drupal); \ No newline at end of file
+})(jQuery, Drupal);