diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/assets/javascripts/gfm_auto_complete.js | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/assets/javascripts/gfm_auto_complete.js')
-rw-r--r-- | app/assets/javascripts/gfm_auto_complete.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index bf29a356abd..8cb2e9e249b 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -3,6 +3,7 @@ import '~/lib/utils/jquery_at_who'; import { escape as lodashEscape, sortBy, template, escapeRegExp } from 'lodash'; import * as Emoji from '~/emoji'; import axios from '~/lib/utils/axios_utils'; +import { loadingIconForLegacyJS } from '~/loading_icon_for_legacy_js'; import { s__, __, sprintf } from '~/locale'; import { isUserBusy } from '~/set_status_modal/utils'; import SidebarMediator from '~/sidebar/sidebar_mediator'; @@ -574,6 +575,10 @@ class GfmAutoComplete { // Do not match if there is no `~` before the cursor return null; } + if (subtext.endsWith('~~')) { + // Do not match if there are two consecutive `~` characters (strikethrough) before the cursor + return null; + } const lastCandidate = subtext.split(flag).pop(); if (labels.find((label) => label.title.startsWith(lastCandidate))) { return lastCandidate; @@ -953,9 +958,14 @@ GfmAutoComplete.Contacts = { return `<li><small>${firstName} ${lastName}</small> ${escape(email)}</li>`; }, }; + +const loadingSpinner = loadingIconForLegacyJS({ + inline: true, + classes: ['gl-mr-2'], +}).outerHTML; + GfmAutoComplete.Loading = { - template: - '<li style="pointer-events: none;"><span class="spinner align-text-bottom mr-1"></span>Loading...</li>', + template: `<li style="pointer-events: none;">${loadingSpinner}Loading...</li>`, }; export default GfmAutoComplete; |