summaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-02-16 03:03:32 +0000
committerGitHub <noreply@github.com>2021-02-16 11:03:32 +0800
commit60ef2a7c67c33287be1872b8d4ee3de6a38ed3a9 (patch)
tree8325f7e4703627dcdb6ba7b42dbe6597ced2d627 /web_src/js
parent0a9a484e1e2c082f7ebd747837e9c9557b3bacac (diff)
downloadgitea-60ef2a7c67c33287be1872b8d4ee3de6a38ed3a9.tar.gz
gitea-60ef2a7c67c33287be1872b8d4ee3de6a38ed3a9.zip
Add fullTextSearch to dropdowns by default (#14694)
This PR adds `fullTextSearch: 'exact'` to most dropdown invocations meaning that if there is a search box for the dropdown it will automatically do a fullTextSearch looking for the provided fragment instead of starting at the beginning We should consider changing other places that use `fullTextSearch: true` to `'exact'` because these will be using a fuzzy-textual search that doesn't necessarily return the expected results. Fix #14689 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/features/gitgraph.js1
-rw-r--r--web_src/js/index.js14
2 files changed, 11 insertions, 4 deletions
diff --git a/web_src/js/features/gitgraph.js b/web_src/js/features/gitgraph.js
index 570d16059f..cd2668ad35 100644
--- a/web_src/js/features/gitgraph.js
+++ b/web_src/js/features/gitgraph.js
@@ -74,6 +74,7 @@ export default async function initGitGraph() {
$('#flow-select-refs-dropdown').dropdown('set selected', dropdownSelected);
$('#flow-select-refs-dropdown').dropdown({
clearable: true,
+ fullTextSeach: 'exact',
onRemove(toRemove) {
if (toRemove === '...flow-hide-pr-refs') {
params.delete('hide-pr-refs');
diff --git a/web_src/js/index.js b/web_src/js/index.js
index 0d60c21cca..c67b3c809b 100644
--- a/web_src/js/index.js
+++ b/web_src/js/index.js
@@ -2408,18 +2408,23 @@ $(document).ready(async () => {
});
// Semantic UI modules.
- $('.dropdown:not(.custom)').dropdown();
+ $('.dropdown:not(.custom)').dropdown({
+ fullTextSearch: 'exact'
+ });
$('.jump.dropdown').dropdown({
action: 'hide',
onShow() {
$('.poping.up').popup('hide');
- }
+ },
+ fullTextSearch: 'exact'
});
$('.slide.up.dropdown').dropdown({
- transition: 'slide up'
+ transition: 'slide up',
+ fullTextSearch: 'exact'
});
$('.upward.dropdown').dropdown({
- direction: 'upward'
+ direction: 'upward',
+ fullTextSearch: 'exact'
});
$('.ui.accordion').accordion();
$('.ui.checkbox').checkbox();
@@ -3465,6 +3470,7 @@ function initTopicbar() {
topicDropdown.dropdown({
allowAdditions: true,
forceSelection: false,
+ fullTextSearch: 'exact',
fields: {name: 'description', value: 'data-value'},
saveRemoteData: false,
label: {