Bugzilla – Attachment 172393 Details for
Bug 38071
"Clear filter" on catalogue details page always disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38071: Add behavior to work with filters
Bug-38071-Add-behavior-to-work-with-filters.patch (text/plain), 1.69 KB, created by
Pedro Amorim
on 2024-10-04 12:43:11 UTC
(
hide
)
Description:
Bug 38071: Add behavior to work with filters
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-10-04 12:43:11 UTC
Size:
1.69 KB
patch
obsolete
>From 705e2d53efa38a8d0b4ec2ab12f4c768726119a8 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 4 Oct 2024 10:39:18 +0000 >Subject: [PATCH] Bug 38071: Add behavior to work with filters > >Consider column filters values when deciding if the 'clear filter' >should be enabled or not. >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index daab5c2c0ed..6a96ce163dd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -70,8 +70,8 @@ var dataTablesDefaults = { > } > }; > >-function toggledClearFilter(searchText, tableId){ >- if( searchText == "" ){ >+function toggledClearFilter(searchText, tableId, searchFilters){ >+ if( searchText == "" && searchFilters === false ){ > $("#" + tableId + "_wrapper").find(".dt_button_clear_filter").addClass("disabled"); > } else { > $("#" + tableId + "_wrapper").find(".dt_button_clear_filter").removeClass("disabled"); >@@ -1007,7 +1007,10 @@ function _dt_add_delay(table_dt, table_node, delay_ms) { > // enable or disable the "Clear filter" button based on > // the presence of a search string > this.on( 'search.dt', function ( e, settings ) { >- toggledClearFilter(settings.oPreviousSearch.sSearch, tableId); >+ let searchFilters = settings.aoPreSearchCols.some(function (value) { >+ return value.sSearch != ""; >+ }); >+ toggledClearFilter(settings.oPreviousSearch.sSearch, tableId, searchFilters); > }); > } > >-- >2.43.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 38071
:
172390
|
172391
|
172392
|
172393
|
172394
|
172444
|
172446
|
172494