language.admin.js 889 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/2815083
  5. * @preserve
  6. **/
  7. (function ($, Drupal) {
  8. Drupal.behaviors.negotiationLanguage = {
  9. attach: function attach() {
  10. var $configForm = $('#language-negotiation-configure-form');
  11. var inputSelector = 'input[name$="[configurable]"]';
  12. function toggleTable(checkbox) {
  13. var $checkbox = $(checkbox);
  14. $checkbox.closest('.table-language-group').find('table, .tabledrag-toggle-weight').toggle($checkbox.prop('checked'));
  15. }
  16. $configForm.once('negotiation-language-admin-bind').on('change', inputSelector, function (event) {
  17. toggleTable(event.target);
  18. });
  19. $configForm.find(inputSelector + ':not(:checked)').each(function (index, element) {
  20. toggleTable(element);
  21. });
  22. }
  23. };
  24. })(jQuery, Drupal);