Bug 26008: Remove the use of jquery.checkboxes plugin from OPAC cart
This patch removes the use of the jquery.checkboxes plugin from the OPAC cart and replaces its functionality with "plain" jQuery. To test, apply the patch and add some items to the Cart in the OPAC. - Open the Cart window in the OPAC by clicking the "Cart" link in the header. - Test that the "Select all" and "Clear all" links work correctly to check and uncheck all checkboxes. - Controls like "Remove" and "Place hold" should be enabled or disabled according to whether there are any checked checkboxes. - Test that manually checking a checkbox correctly enables or disables the link options too. - Test that the "Remove" or "Place hold" controls work correctly, applying to only the checked checkboxes. Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Bug 26008: (follow-up) Removed checkboxed class This patch removes the "checkboxed" class which was previously associated with the jquery.checkboxes plugin and is now obsolete. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
4cf5ef239f
commit
db15875207
1 changed files with 16 additions and 21 deletions
|
@ -81,7 +81,7 @@
|
||||||
</div> <!-- /#floating -->
|
</div> <!-- /#floating -->
|
||||||
|
|
||||||
[% IF ( verbose ) %]
|
[% IF ( verbose ) %]
|
||||||
<form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
|
<form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
|
||||||
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
|
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
|
||||||
<h2>
|
<h2>
|
||||||
<input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
|
<input type="checkbox" class="cb" value="[% BIBLIO_RESULT.biblionumber | html %]" name="bib[% BIBLIO_RESULT.biblionumber | html %]" id="bib[% BIBLIO_RESULT.biblionumber | html %]">
|
||||||
|
@ -256,7 +256,7 @@
|
||||||
|
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
|
|
||||||
<form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
|
<form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
|
||||||
<table id="itemst" class="table table-bordered table-striped">
|
<table id="itemst" class="table table-bordered table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -324,7 +324,6 @@
|
||||||
[% INCLUDE 'opac-bottom.inc' %]
|
[% INCLUDE 'opac-bottom.inc' %]
|
||||||
|
|
||||||
[% BLOCK jsinclude %]
|
[% BLOCK jsinclude %]
|
||||||
[% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
|
|
||||||
[% Asset.js("lib/hc-sticky.js") | $raw %]
|
[% Asset.js("lib/hc-sticky.js") | $raw %]
|
||||||
[% INCLUDE 'datatables.inc' %]
|
[% INCLUDE 'datatables.inc' %]
|
||||||
<script>
|
<script>
|
||||||
|
@ -430,26 +429,22 @@
|
||||||
tagCanceled();
|
tagCanceled();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#CheckAll").click(function(){
|
$("#CheckAll").click(function(e){
|
||||||
var checked = [];
|
e.preventDefault();
|
||||||
$(".checkboxed").checkCheckboxes("*", true).each(
|
$(".cb").each(function(){
|
||||||
function() {
|
$(this).prop("checked", true);
|
||||||
selRecord(this.value,true);
|
selRecord(this.value, true);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
enableCheckboxActions();
|
enableCheckboxActions();
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#CheckNone").click(function(){
|
$("#CheckNone").click(function(e){
|
||||||
var checked = [];
|
e.preventDefault();
|
||||||
$(".checkboxed").unCheckCheckboxes("*",true).each(
|
$(".cb").each(function(){
|
||||||
function() {
|
$(this).prop("checked", false);
|
||||||
selRecord(this.value,false);
|
selRecord(this.value, false);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
enableCheckboxActions();
|
enableCheckboxActions();
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if( $("#itemst").length > 0 ){
|
if( $("#itemst").length > 0 ){
|
||||||
|
@ -490,8 +485,8 @@
|
||||||
|
|
||||||
function enableCheckboxActions(){
|
function enableCheckboxActions(){
|
||||||
// Enable/disable controls if checkboxes are checked
|
// Enable/disable controls if checkboxes are checked
|
||||||
var checkedBoxes = $(".checkboxed input:checkbox:checked");
|
var checkedBoxes = $(".cb:checked");
|
||||||
if ($(checkedBoxes).size()) {
|
if ( checkedBoxes.length ) {
|
||||||
$("#selections").html(_("With selected titles: "));
|
$("#selections").html(_("With selected titles: "));
|
||||||
$("#selections-toolbar .links a").removeClass("disabled");
|
$("#selections-toolbar .links a").removeClass("disabled");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue