Bugzilla – Attachment 172494 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: Ensure search.dt is triggered
Bug-38071-Ensure-searchdt-is-triggered.patch (text/plain), 2.30 KB, created by
Martin Renvoize (ashimema)
on 2024-10-07 16:16:03 UTC
(
hide
)
Description:
Bug 38071: Ensure search.dt is triggered
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-07 16:16:03 UTC
Size:
2.30 KB
patch
obsolete
>From 39e54ee842d33dade7a31e397ee4558073ce5ff0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Oct 2024 10:49:36 +0200 >Subject: [PATCH] Bug 38071: Ensure search.dt is triggered > >I don't really understand why the previous code is not working, but >the search.dt event handler is not correctly set when initComplete is >passed to the constructor (for instance from the patrons search) > >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 5e319843062..25a4bda3899 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -59,12 +59,6 @@ var dataTablesDefaults = { > var tableId = settings.nTable.id > var state = settings.oLoadedState; > state && toggledClearFilter(state.search.search, tableId); >- // When the DataTables search function is triggered, >- // 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); >- }); > > if (settings.ajax) { > let table_node = $("#" + tableId); >@@ -1001,9 +995,16 @@ function _dt_add_delay(table_dt, table_node, delay_ms) { > _dt_add_filters(this, table_dt, filters_options); > } > >- table.DataTable().on("column-visibility.dt", function(){_dt_on_visibility(add_filters, table, table_dt);}) >+ table_dt.on("column-visibility.dt", function(){_dt_on_visibility(add_filters, table, table_dt);}) > .columns( hidden_ids ).visible( false ); > >+ table_dt.on( 'search.dt', function ( e, settings ) { >+ // When the DataTables search function is triggered, >+ // enable or disable the "Clear filter" button based on >+ // the presence of a search string >+ toggledClearFilter(settings.oPreviousSearch.sSearch, settings.nTable.id); >+ }); >+ > return table; > }; > >-- >2.46.2
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