Loading js/autofill.js +2 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,8 @@ Drupal.behaviors.LinkTextAutofillBehavior = { attach: function (context, drupalSettings) { $('.link-text-autofill', context).once('link_text_autofill').each(function () { // See https://www.drupal.org/node/3158256 for the syntax of once(). $(once('link_text_autofill', '.link-text-autofill', context)).each(function () { // Attach a listener to all autocomplete elements inside this. const $all_autocompletes = $('input.form-autocomplete', this); $all_autocompletes.on('autocompleteclose', function (e) { Loading link_text_autofill.info.yml +1 −1 Original line number Diff line number Diff line name: Link Text Autofill type: module description: Improves UX of link fields by auto-filling the text with the referenced entity label, if empty. core_version_requirement: 9.x core_version_requirement: ^9 || ^10 package: Fields dependencies: Loading link_text_autofill.libraries.yml +1 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,4 @@ autofill: dependencies: - core/jquery - core/drupal - core/once Loading
js/autofill.js +2 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,8 @@ Drupal.behaviors.LinkTextAutofillBehavior = { attach: function (context, drupalSettings) { $('.link-text-autofill', context).once('link_text_autofill').each(function () { // See https://www.drupal.org/node/3158256 for the syntax of once(). $(once('link_text_autofill', '.link-text-autofill', context)).each(function () { // Attach a listener to all autocomplete elements inside this. const $all_autocompletes = $('input.form-autocomplete', this); $all_autocompletes.on('autocompleteclose', function (e) { Loading
link_text_autofill.info.yml +1 −1 Original line number Diff line number Diff line name: Link Text Autofill type: module description: Improves UX of link fields by auto-filling the text with the referenced entity label, if empty. core_version_requirement: 9.x core_version_requirement: ^9 || ^10 package: Fields dependencies: Loading
link_text_autofill.libraries.yml +1 −0 Original line number Diff line number Diff line Loading @@ -4,3 +4,4 @@ autofill: dependencies: - core/jquery - core/drupal - core/once