Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Helper for CheckboxSelectMultiple widget which allows user to select/…
…unselect all available options.
- Loading branch information
dzejkob
committed
Oct 30, 2020
1 parent
58b04c0
commit 329f07c
Showing
9 changed files
with
120 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* Adds additional utility buttons to form groups having "checkbox-utils" class | ||
* which allows user to select unselect all options in CheckboxSelectMultiple widgets. | ||
*/ | ||
$(function () { | ||
var $inputs = $('.checkbox-utils'); | ||
|
||
$inputs.each(function (index) { | ||
var $elem = $(this), | ||
$label = $elem.find('label.control-label:first-child'); | ||
|
||
$label.after( | ||
'<button class="btn btn-primary unselect-all-btn" type="button">' + | ||
'Odznacz wszystkie' + | ||
'</button>' + | ||
'<button class="btn btn-primary select-all-btn" type="button">' + | ||
'Zaznacz wszystkie' + | ||
'</button>' | ||
); | ||
|
||
$('.checkbox-utils .select-all-btn').click(function (event) { | ||
$elem.find('input[type="checkbox"]').prop("checked", true); | ||
}); | ||
$('.checkbox-utils .unselect-all-btn').click(function (event) { | ||
$elem.find('input[type="checkbox"]').prop("checked", false); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.