
| Current Path : /var/www/html/strat/web/modules/contrib/webform/js/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/strat/web/modules/contrib/webform/js/webform.contextual.js |
/**
* @file
* JavaScript behavior to remove destination from contextual links.
*/
(function ($, once) {
'use strict';
// Bind click event to all .contextual links which are
// dynamically inserted via Ajax.
// @see webform_contextual_links_view_alter()
// @see Drupal.behaviors.contextual
$(document).on('click', '.contextual', function () {
$(once('webform-contextual', 'a.webform-contextual', this)).each(function () {
this.href = this.href.split('?')[0];
// Add ?_webform_test={webform} to the current page's URL.
// phpcs:ignore
if (/webform\/([^/]+)\/test$/.test(this.href)) {
this.href = window.location.pathname + '?_webform_test=' + RegExp.$1;
}
});
});
})(jQuery, once);