Bugzilla – Attachment 158706 Details for
Bug 35284
No more delay between 2 DT requests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35284: Fix Vue tables
Bug-35284-Fix-Vue-tables.patch (text/plain), 2.17 KB, created by
Jonathan Druart
on 2023-11-09 09:03:20 UTC
(
hide
)
Description:
Bug 35284: Fix Vue tables
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-11-09 09:03:20 UTC
Size:
2.17 KB
patch
obsolete
>From 7378e644363b4b1740f816bf9b02e97bc2e6d01b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 9 Nov 2023 08:58:11 +0100 >Subject: [PATCH] Bug 35284: Fix Vue tables > >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 025b63ea38e..d0e27a14625 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -63,7 +63,13 @@ var dataTablesDefaults = { > }); > > if (settings.ajax) { >- _dt_add_delay($("#"+tableId)); >+ let table_node = $("#" + tableId); >+ if ( typeof this.api === 'function' ) { >+ _dt_add_delay(this.api(), table_node); >+ } else { >+ let dt = $(table_node).DataTable(); >+ _dt_add_delay(dt, table_node); >+ } > } > } > }; >@@ -930,9 +936,8 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { > // These keys must not launch filtering > var blacklist_keys = new Array(0, 16, 17, 18, 37, 38, 39, 40); > >-function _dt_add_delay(table_node, delay_ms) { >+function _dt_add_delay(table_dt, table_node, delay_ms) { > >- let dt = table_node.DataTable(); > delay = (typeof delay == 'undefined') ? 500 : delay; > > var previousSearch = null; >@@ -944,14 +949,14 @@ function _dt_add_delay(table_node, delay_ms) { > if (blacklist_keys.indexOf(event.keyCode) != -1) { > return; > } else if ( event.keyCode == '13' ) { >- dt.search($(input).val()).draw(); >+ table_dt.search($(input).val()).draw(); > } else { > let val = $(input).val(); > if (previousSearch === null || previousSearch != val){ > window.clearTimeout(timerId); > previousSearch = val; > timerId = window.setTimeout(function(){ >- dt.search($(input).val()).draw(); >+ table_dt.search($(input).val()).draw(); > }, delay); > } > } >-- >2.34.1
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 35284
:
158676
|
158705
|
158706
|
158707
|
158708
|
158776
|
158777
|
158778
|
158779
|
158783
|
158784
|
158785
|
158786
|
158787