[Rt-commit] rt branch 5.0/bootstrap-select-live-search updated. rt-5.0.3-215-g38084a5f4e
BPS Git Server
git at git.bestpractical.com
Fri Mar 24 19:54:14 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/bootstrap-select-live-search has been updated
via 38084a5f4ed76c29f2aa44963a977161bf8a7aff (commit)
from 8e794279400d887a1d72a32c2ed1e377112eaa88 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 38084a5f4ed76c29f2aa44963a977161bf8a7aff
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Fri Mar 24 15:54:01 2023 -0400
Make SelectLiveSearchLimit default easier to find
diff --git a/share/html/Elements/JavascriptConfig b/share/html/Elements/JavascriptConfig
index 4b9b7b52b5..fa8aba736d 100644
--- a/share/html/Elements/JavascriptConfig
+++ b/share/html/Elements/JavascriptConfig
@@ -51,6 +51,11 @@ $Config->{$_} = RT->Config->Get( $_, $session{CurrentUser} )
for qw(rtname WebPath MessageBoxRichText MessageBoxRichTextHeight
MaxAttachmentSize WebDefaultStylesheet);
+# JS-only config value. Setting default here, can be reset with
+# the Data callback below.
+# Converts dropdowns longer than the limit to live search selects.
+$Config->{'SelectLiveSearchLimit'} = 10;
+
my $CurrentUser = {};
if ($session{CurrentUser} and $session{CurrentUser}->id) {
$CurrentUser->{$_} = $session{CurrentUser}->$_
diff --git a/share/static/js/util.js b/share/static/js/util.js
index bd14574530..5adf277abf 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -1412,9 +1412,7 @@ function toggleTransactionDetails () {
function updateSelectpickerLiveSearch (element) {
element ||= jQuery('.selectpicker');
element.filter(':not([data-live-search])').each(function() {
- // Unlike WebPath, SelectLiveSearchLimit is not a real RT config, but
- // can also be customized in Data callback of /Elements/JavascriptConfig
- jQuery(this).attr('data-live-search', jQuery(this).find('option').length >= (RT.Config.SelectLiveSearchLimit || 10) ? true : false );
+ jQuery(this).attr('data-live-search', jQuery(this).find('option').length >= RT.Config.SelectLiveSearchLimit ? true : false );
});
}
-----------------------------------------------------------------------
Summary of changes:
share/html/Elements/JavascriptConfig | 5 +++++
share/static/js/util.js | 4 +---
2 files changed, 6 insertions(+), 3 deletions(-)
hooks/post-receive
--
rt
More information about the rt-commit
mailing list