[Rt-commit] rt branch 5.0/update-selectpicker-live-search-earlier created. rt-5.0.3-441-g92247e25e2

BPS Git Server git at git.bestpractical.com
Mon Apr 10 15:55:10 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/update-selectpicker-live-search-earlier has been created
        at  92247e25e2e1e4f2610b57dc30cc1e1702ffca81 (commit)

- Log -----------------------------------------------------------------
commit 92247e25e2e1e4f2610b57dc30cc1e1702ffca81
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Sat Apr 8 09:59:21 2023 +0800

    Update data-live-search attr for bootstrap select before initialization
    
    The initialization is registered via jQuery(window).on('load'), which
    usually is called after items registered via jQuery.ready(), as the
    former means when all assets are loaded and the latter means when DOM is
    ready(quite like DOMContentLoaded but not precisely).
    
    Unfortunately this isn't always true, at least on Safari and Firefox.
    Sometimes items of jQuery.ready() registered in external js files got
    executed after DOMContentLoaded event, which could be later than items
    of jQuery(window).on('load').
    
    Here we need to make sure the live-search option is set before
    initialization, otherwise it won't take effect.
    
    See also https://api.jquery.com/ready/

diff --git a/share/html/Elements/Footer b/share/html/Elements/Footer
index 0de4f1972b..2a79085a18 100644
--- a/share/html/Elements/Footer
+++ b/share/html/Elements/Footer
@@ -80,6 +80,7 @@
     </div>
 <script type="text/javascript">
 RT.UserMessages = <% JSON( \%UserMessages ) |n%>;
+updateSelectpickerLiveSearch();
 </script>
   </body>
 </html>
diff --git a/share/static/js/util.js b/share/static/js/util.js
index fcc22f3388..4685ed2978 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -1359,8 +1359,6 @@ jQuery(function () {
             });
         });
     });
-
-    updateSelectpickerLiveSearch();
 });
 
 // focus jquery object in window, only moving the screen when necessary

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list