2015-06-05 20:17:55 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
2017-05-23 14:30:14 +00:00
|
|
|
* https://www.drupal.org/node/2815083
|
2017-05-19 22:12:53 +00:00
|
|
|
* @preserve
|
|
|
|
**/
|
2015-06-05 20:17:55 +00:00
|
|
|
|
2013-07-03 12:48:55 +00:00
|
|
|
(function ($, Drupal) {
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.behaviors.negotiationLanguage = {
|
2017-05-19 22:12:53 +00:00
|
|
|
attach: function attach() {
|
2014-01-27 21:41:32 +00:00
|
|
|
var $configForm = $('#language-negotiation-configure-form');
|
|
|
|
var inputSelector = 'input[name$="[configurable]"]';
|
2017-05-19 22:12:53 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
function toggleTable(checkbox) {
|
|
|
|
var $checkbox = $(checkbox);
|
2017-05-19 22:12:53 +00:00
|
|
|
|
|
|
|
$checkbox.closest('.table-language-group').find('table, .tabledrag-toggle-weight').toggle($checkbox.prop('checked'));
|
2014-01-27 21:41:32 +00:00
|
|
|
}
|
2014-07-02 18:48:06 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
$configForm.once('negotiation-language-admin-bind').on('change', inputSelector, function (event) {
|
|
|
|
toggleTable(event.target);
|
|
|
|
});
|
2017-05-19 22:12:53 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
$configForm.find(inputSelector + ':not(:checked)').each(function (index, element) {
|
|
|
|
toggleTable(element);
|
|
|
|
});
|
2013-07-03 12:48:55 +00:00
|
|
|
}
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2017-05-19 22:12:53 +00:00
|
|
|
})(jQuery, Drupal);
|