diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-18 21:10:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-18 21:10:54 +0300 |
commit | 35144b7075d343a8b3676708da03986103ed5dd1 (patch) | |
tree | d1e36c045de79c04f0c4a0fccd775bc5c53ccbc5 /app | |
parent | bfc7eec58ee891178d2a81c424f6c1de22feae5f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/gfm_autocomplete/utils.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/vue_shared/components/gfm_autocomplete/utils.js b/app/assets/javascripts/vue_shared/components/gfm_autocomplete/utils.js index ab0fe21cb99..809932b0f29 100644 --- a/app/assets/javascripts/vue_shared/components/gfm_autocomplete/utils.js +++ b/app/assets/javascripts/vue_shared/components/gfm_autocomplete/utils.js @@ -9,6 +9,8 @@ const memberLimit = 10; const nonWordOrInteger = /\W|^\d+$/; +export const menuItemLimit = 100; + export const GfmAutocompleteType = { Emojis: 'emojis', Issues: 'issues', @@ -31,6 +33,7 @@ export const tributeConfig = { config: { trigger: ':', lookup: (value) => value, + menuItemLimit, menuItemTemplate: ({ original }) => `${original} ${Emoji.glEmojiTag(original)}`, selectTemplate: ({ original }) => `:${original}:`, }, @@ -40,6 +43,7 @@ export const tributeConfig = { config: { trigger: '#', lookup: (value) => `${value.iid}${value.title}`, + menuItemLimit, menuItemTemplate: ({ original }) => `<small>${original.reference || original.iid}</small> ${escape(original.title)}`, selectTemplate: ({ original }) => original.reference || `#${original.iid}`, @@ -50,6 +54,7 @@ export const tributeConfig = { config: { trigger: '~', lookup: 'title', + menuItemLimit, menuItemTemplate: ({ original }) => ` <span class="dropdown-label-box" style="background: ${escape(original.color)};"></span> ${escape(original.title)}`, @@ -132,6 +137,7 @@ export const tributeConfig = { config: { trigger: '!', lookup: (value) => `${value.iid}${value.title}`, + menuItemLimit, menuItemTemplate: ({ original }) => `<small>${original.reference || original.iid}</small> ${escape(original.title)}`, selectTemplate: ({ original }) => original.reference || `!${original.iid}`, @@ -142,6 +148,7 @@ export const tributeConfig = { config: { trigger: '%', lookup: 'title', + menuItemLimit, menuItemTemplate: ({ original }) => escape(original.title), selectTemplate: ({ original }) => `%"${escape(original.title)}"`, }, @@ -152,6 +159,7 @@ export const tributeConfig = { trigger: '/', fillAttr: 'name', lookup: (value) => `${value.name}${value.aliases.join()}`, + menuItemLimit, menuItemTemplate: ({ original }) => { const aliases = original.aliases.length ? `<small>(or /${original.aliases.join(', /')})</small>` @@ -180,6 +188,7 @@ export const tributeConfig = { trigger: '$', fillAttr: 'id', lookup: (value) => `${value.id}${value.title}`, + menuItemLimit, menuItemTemplate: ({ original }) => `<small>${original.id}</small> ${escape(original.title)}`, }, }, |