Bugzilla – Attachment 107024 Details for
Bug 26008
Remove the use of jquery.checkboxes plugin from OPAC cart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26008: Remove the use of jquery.checkboxes plugin from OPAC cart
Bug-26008-Remove-the-use-of-jquerycheckboxes-plugi.patch (text/plain), 3.62 KB, created by
Owen Leonard
on 2020-07-17 14:54:17 UTC
(
hide
)
Description:
Bug 26008: Remove the use of jquery.checkboxes plugin from OPAC cart
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-07-17 14:54:17 UTC
Size:
3.62 KB
patch
obsolete
>From 337823274784d5d5d425261fd7c5d4c7b6554809 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 17 Jul 2020 14:43:39 +0000 >Subject: [PATCH] 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. >--- > .../opac-tmpl/bootstrap/en/modules/opac-basket.tt | 33 +++++++++------------- > 1 file changed, 14 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >index d85427b60a..d7563ff176 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >@@ -324,7 +324,6 @@ > [% INCLUDE 'opac-bottom.inc' %] > > [% BLOCK jsinclude %] >- [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] > [% Asset.js("lib/hc-sticky.js") | $raw %] > [% INCLUDE 'datatables.inc' %] > <script> >@@ -430,26 +429,22 @@ > tagCanceled(); > }); > >- $("#CheckAll").click(function(){ >- var checked = []; >- $(".checkboxed").checkCheckboxes("*", true).each( >- function() { >- selRecord(this.value,true); >- } >- ); >+ $("#CheckAll").click(function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", true); >+ selRecord(this.value, true); >+ }); > enableCheckboxActions(); >- return false; > }); > >- $("#CheckNone").click(function(){ >- var checked = []; >- $(".checkboxed").unCheckCheckboxes("*",true).each( >- function() { >- selRecord(this.value,false); >- } >- ); >+ $("#CheckNone").click(function(e){ >+ e.preventDefault(); >+ $(".cb").each(function(){ >+ $(this).prop("checked", false); >+ selRecord(this.value, false); >+ }); > enableCheckboxActions(); >- return false; > }); > > if( $("#itemst").length > 0 ){ >@@ -490,8 +485,8 @@ > > function enableCheckboxActions(){ > // Enable/disable controls if checkboxes are checked >- var checkedBoxes = $(".checkboxed input:checkbox:checked"); >- if ($(checkedBoxes).size()) { >+ var checkedBoxes = $(".cb:checked"); >+ if ( checkedBoxes.length ) { > $("#selections").html(_("With selected titles: ")); > $("#selections-toolbar .links a").removeClass("disabled"); > } else { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26008
:
107024
|
107648
|
108020
|
108154