Skip to content

Commit

Permalink
Merge pull request #1481 from USEPA/EPAD8-2544-ck4-link-modal-not-pop…
Browse files Browse the repository at this point in the history
…ulating-live

[EPAD8-2544] Resolving issue with ck4 plugin code calling removed jqu…
  • Loading branch information
carsoncho authored Sep 9, 2024
2 parents 87f22a6 + c9947cb commit 17450e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ epa-wysiwyg-linkit:
js:
js/epa_wysiwyg_linkit.js: {}
dependencies:
- core/drupal
- core/jquery
- core/once

# CKEditor5 libraries
epa-new-tag-ckeditor5:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* EPA Linkit customizations.
*/

(function ($) {
(function (Drupal, $, once) {

Drupal.behaviors.epaWysiwygLinkit = {
attach: function (context) {
Expand All @@ -13,21 +13,20 @@

// Populate the defaultInput with the value of hrefInput on load, if there
// is one.
$('[name="attributes[href]"]', context).once('epaWysiwygLinkitInitInput').each(function() {
$(once('epaWysiwygLinkitInitInput', '[name="attributes[href]"]', context)).each(function() {
if ($hrefInput.val() != '') {
$defaultInput.val($hrefInput.val());
$hrefInput.val('');
}
});


// Clear the linkit input values when the profile is changed to reset the
// autocomplete results.
$('[name="attributes[select-profile]"]', context).once('epaWysiwygLinkitResetInput').change(function() {
$(once('epaWysiwygLinkitResetInput', '[name="attributes[select-profile]"]', context)).change(function() {
$defaultInput.val('');
$webAreaInput.val('');
});
}
};

})(jQuery);
})(Drupal, jQuery, once);

0 comments on commit 17450e0

Please sign in to comment.