Bugzilla – Attachment 172390 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: Preparation
Bug-38071-Preparation.patch (text/plain), 2.21 KB, created by
Pedro Amorim
on 2024-10-04 12:43:03 UTC
(
hide
)
Description:
Bug 38071: Preparation
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-10-04 12:43:03 UTC
Size:
2.21 KB
patch
obsolete
>From 270ec48a30d181f7b18ce94e34f1397a4542cf58 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 4 Oct 2024 10:23:55 +0000 >Subject: [PATCH] Bug 38071: Preparation > >Move kohaTable's toggleable clear filter button to its own function >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 25 +++++++++++-------- > 1 file changed, 15 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 5e319843062..daab5c2c0ed 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -56,18 +56,10 @@ var dataTablesDefaults = { > "pageLength": 20, > "fixedHeader": true, > initComplete: function( settings ) { >- 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); >- }); >+ $(this).kohaTableToggleClearFilter(settings); > > if (settings.ajax) { >- let table_node = $("#" + tableId); >+ let table_node = $("#" + settings.nTable.id); > if ( typeof this.api === 'function' ) { > _dt_add_delay(this.api(), table_node); > } else { >@@ -1007,4 +999,17 @@ function _dt_add_delay(table_dt, table_node, delay_ms) { > return table; > }; > >+ $.fn.kohaTableToggleClearFilter = function(settings) { >+ 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); >+ }); >+ } >+ >+ > })(jQuery); >-- >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