[TikiWiki-commits] [Git][tikiwiki/tiki][24.x] [BP][FIX] customsearch: trigger live filtering on input without TableSorter

"Olivier Kango \(@olivierkango\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <69c3e2dc262b2_3b2f963648375c@gitlab-sidekiq-low-urgency-cpu-bound-v2-847db959-7hv22.mail>

Olivier Kango pushed to branch 24.x at Tiki Wiki CMS Groupware / Tiki


Commits:
a1973596 by Olivier Kango at 2026-03-25T15:20:25+02:00
[BP][FIX] customsearch: trigger live filtering on input without TableSorter
---
* [BP][FIX] customsearch: trigger live filtering on input without TableSorter
---
* [BP][FIX] customsearch: trigger live filtering on input without TableSorter
---
* [BP][FIX] customsearch: trigger live filtering on input without TableSorter
---
* [FIX] customsearch: trigger live filtering on input without TableSorter
---
* [FIX] customsearch: trigger live filtering on input without TableSorter

See merge request tikiwiki/tiki!9789

(cherry picked from commit fbc2991605a3b6489428a414bba17e7fdd1d844e)

See merge request tikiwiki/tiki!9845

(cherry picked from commit 503e3cd27c754156c858ddec9b2154eeba01ee67)

See merge request tikiwiki/tiki!9846

(cherry picked from commit 8cb75e2cb0f16d461c54fe63c7dd22f972b402a3)

See merge request tikiwiki/tiki!9848

(cherry picked from commit a8aad9ea1673d19cc16a75490b67a0da0311bffa)

See merge request tikiwiki/tiki!9849

- - - - -


1 changed file:

- lib/wiki-plugins/wikiplugin_customsearch.php


Changes:

=====================================
lib/wiki-plugins/wikiplugin_customsearch.php
=====================================
@@ -339,11 +339,14 @@ function wikiplugin_customsearch($data, $params)
         $offset = (int) $_SESSION["customsearch_$id"]["offset"];
     }
 
+    $autosearchdelay = ! empty($params['autosearchdelay']) ? max(0, (int) $params['autosearchdelay']) : 0;
+    $loadDelay = $autosearchdelay > 0 ? 0 : 1000;
+
     $options = [
         'searchfadetext' => tr('Loading...'),
         'searchfadediv' => $params['searchfadediv'],
         'results' => empty($params['destdiv']) ? "#customsearch_{$id}_results" : "#{$params['destdiv']}",
-        'autosearchdelay' => ! empty($params['autosearchdelay']) ? max(1500, (int) $params['autosearchdelay']) : 0,
+        'autosearchdelay' => $autosearchdelay,
         'searchonload' => (int) $params['searchonload'],
         'requireinput' => (bool) $params['requireinput'],
         'origrequireinput' => (bool) $params['requireinput'],
@@ -380,7 +383,7 @@ var customsearch$id = {
     },
     auto: function () {
     },
-    _executor: delayedExecutor(1000, function (cs) {
+    _executor: delayedExecutor($loadDelay, function (cs) {
         var selector = '#' + cs.options.searchfadediv;
         if (cs.options.searchfadediv.length <= 1 && $(selector).length === 0) {
             selector = '#customsearch_' + cs.id;
@@ -746,7 +749,7 @@ function cs_design_input($id, $fieldname, $fieldid, $arguments, $default, &$scri
     $script .= "
 (function (id, config, fieldname) {
     var field = $('#' + id);
-    field.change(function() {
+    var updateFilter = function () {
 
         var partial = '';
         var value = $(this).val();
@@ -779,7 +782,13 @@ function cs_design_input($id, $fieldname, $fieldid, $arguments, $default, &$scri
 
         customsearch$id.add($(this).attr('id'), filter);
         customsearch$id.offset = 0;
-    });
+    };
+
+    field.on('change', updateFilter);
+
+    if (field.is(':text, input[type=search], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=password]')) {
+        field.on('input', updateFilter);
+    }
 
     if (config['default'] || $(field).attr('type') === 'hidden') {
         field.change();



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a1973596b418241bbafc6290c7c5587bb404d1e5

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/a1973596b418241bbafc6290c7c5587bb404d1e5
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.