2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
8 (function ($, Drupal) {
9 Drupal.behaviors.ClickToSelect = {
10 attach: function attach(context) {
11 $('.js-click-to-select-trigger', context).once('media-library-click-to-select').on('click', function (event) {
12 event.preventDefault();
14 var $input = $(event.currentTarget).closest('.js-click-to-select').find('.js-click-to-select-checkbox input');
15 $input.prop('checked', !$input.prop('checked')).trigger('change');
17 $('.js-click-to-select-checkbox input', context).once('media-library-click-to-select').on('change', function (_ref) {
18 var currentTarget = _ref.currentTarget;
20 $(currentTarget).closest('.js-click-to-select').toggleClass('checked', $(currentTarget).prop('checked'));