Bug 31566: 'Patrons selected' counter doubles on 'Select all'
This patch refines the JavaScript which is run when the "Select all" or "Clear all" controls are clicked. The script now checks to see whether the checkbox is checked before triggering the change function. To test, apply the patch and perform a patron search in the staff interface which will return multiple results. - After the patron search results are displayed, test the "Select all" control. The visible search results should all be checked, and the "Patrons selected" counter at the top should be incremented correctly. - Clicking the "Select all" control again should have no effect. The "Patrons selected" counter should not increment again. - Test the "Clear all" control to confirm that checkboxes are unchecked and the counter updates correctly. - Test with multiple pages of patron search results to confirm that the controls work correctly on any page of results.. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
1524afa8c7
commit
aa49b1bed9
1 changed files with 10 additions and 2 deletions
|
@ -252,11 +252,19 @@
|
|||
|
||||
$("#select_all").on("click",function(e){
|
||||
e.preventDefault();
|
||||
$(".selection").prop("checked", true).change();
|
||||
$(".selection").each(function(){
|
||||
if( $(this).prop("checked") == false ){
|
||||
$(this).prop( "checked", true ).change();
|
||||
}
|
||||
});
|
||||
});
|
||||
$("#clear_all").on("click",function(e){
|
||||
e.preventDefault();
|
||||
$(".selection").prop("checked", false).change();
|
||||
$(".selection").each(function(){
|
||||
if( $(this).prop("checked") ){
|
||||
$(this).prop("checked", false ).change();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
[% IF searchmember %]
|
||||
|
|
Loading…
Reference in a new issue