diff --git a/core/modules/content_translation/content_translation.admin.js b/core/modules/content_translation/content_translation.admin.js index 79963c9..d7e7236 100644 --- a/core/modules/content_translation/content_translation.admin.js +++ b/core/modules/content_translation/content_translation.admin.js @@ -112,47 +112,43 @@ } }; -<<<<<<< HEAD -})(jQuery, Drupal, drupalSettings); -======= -/** - * Hides translation checkboxes for disabled field values. - */ -Drupal.behaviors.translationHideDisabled = { - attach: function (context, settings) { - $.each(settings.contentTranslationDependentOptions.translation_sync_options, function (index, element) { - // Get the translatable element checkbox. - var $translatableCheckbox = $(':input[name="instance[settings][translation_sync][' + element + ']"][type="checkbox"]'); - // Try to guess the checkbox that enables the field. - var $enableCheckbox = $(':input[name="instance[settings][' + element + ']"][type="checkbox"]'); - if (!$enableCheckbox.length) { - // If the setting did not exist try adding _field. - $enableCheckbox = $(':input[name="instance[settings][' + element + '_field]"][type="checkbox"]'); - }; - if ($enableCheckbox.length) { - // If the field is not enabled then uncheck and disable the translation - // checkbox. - var uncheckHideCheckboxes = function ($checkbox) { - if (!$checkbox.is(':checked')) { - $translatableCheckbox.prop('checked', false); - // Finds the wrapper form item and hide it. - $translatableCheckbox.closest('.form-item').hide(); - } - else { - // Finds the wrapper form item and shows it. - $translatableCheckbox.closest('.form-item').show(); - } - }; - // Bind on change. - $enableCheckbox.on('change', function (e) { - uncheckHideCheckboxes($(e.target)); - }); - // Process first load. - uncheckHideCheckboxes($enableCheckbox); - } - }); - } -}; - -})(jQuery); ->>>>>>> Applying patch from issue 1920876 comment 7892481 + /** + * Hides translation checkboxes for disabled field values. + */ + Drupal.behaviors.translationHideDisabled = { + attach: function (context, settings) { + $.each(settings.contentTranslationDependentOptions.translation_sync_options, function (index, element) { + // Get the translatable element checkbox. + var $translatableCheckbox = $(':input[name="instance[settings][translation_sync][' + element + ']"][type="checkbox"]'); + // Try to guess the checkbox that enables the field. + var $enableCheckbox = $(':input[name="instance[settings][' + element + ']"][type="checkbox"]'); + if (!$enableCheckbox.length) { + // If the setting did not exist try adding _field. + $enableCheckbox = $(':input[name="instance[settings][' + element + '_field]"][type="checkbox"]'); + } + ; + if ($enableCheckbox.length) { + // If the field is not enabled then uncheck and disable the translation + // checkbox. + var uncheckHideCheckboxes = function ($checkbox) { + if (!$checkbox.is(':checked')) { + $translatableCheckbox.prop('checked', false); + // Finds the wrapper form item and hide it. + $translatableCheckbox.closest('.form-item').hide(); + } + else { + // Finds the wrapper form item and shows it. + $translatableCheckbox.closest('.form-item').show(); + } + }; + // Bind on change. + $enableCheckbox.on('change', function (e) { + uncheckHideCheckboxes($(e.target)); + }); + // Process first load. + uncheckHideCheckboxes($enableCheckbox); + } + }); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file