
| 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.element.select.js |
/**
* @file
* JavaScript behaviors for select menu.
*/
(function ($, Drupal, once) {
'use strict';
/**
* Disable select menu options using JavaScript.
*
* @type {Drupal~behavior}
*/
Drupal.behaviors.webformSelectOptionsDisabled = {
attach: function (context) {
$(once('webform-select-options-disabled', 'select[data-webform-select-options-disabled]', context)).each(function () {
var $select = $(this);
var disabled = $select.attr('data-webform-select-options-disabled').split(/\s*,\s*/);
$select.find('option').filter(function isDisabled() {
return ($.inArray(this.value, disabled) !== -1);
}).attr('disabled', 'disabled');
});
}
};
})(jQuery, Drupal, once);