e1186b790200f90f8aeb91dcac5c317b8e242a81
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Resources / Public / JavaScript / FieldSelectBox.js
1 /**
2 * This file is part of the TYPO3 CMS project.
3 *
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 /**
15 * Check-all / uncheck-all for the Database Recordlist fieldSelectBox
16 */
17 define('TYPO3/CMS/Recordlist/FieldSelectBox', ['jquery'], function($) {
18 "use strict";
19
20 $(function() {
21 $('.fieldSelectBox .checkAll').change(function() {
22 var checked = $(this).prop('checked');
23 var $checkboxes = $('.fieldSelectBox tbody').find(':checkbox');
24 $checkboxes.each(function() {
25 if (!$(this).prop('disabled')) {
26 $(this).prop('checked', checked);
27 }
28 });
29 });
30 });
31
32 });