diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /app/assets/javascripts/vue_shared/components/file_finder | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/file_finder')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/file_finder/index.vue | 40 | ||||
-rw-r--r-- | app/assets/javascripts/vue_shared/components/file_finder/item.vue | 8 |
2 files changed, 25 insertions, 23 deletions
diff --git a/app/assets/javascripts/vue_shared/components/file_finder/index.vue b/app/assets/javascripts/vue_shared/components/file_finder/index.vue index d6f591ccca1..012aca8105a 100644 --- a/app/assets/javascripts/vue_shared/components/file_finder/index.vue +++ b/app/assets/javascripts/vue_shared/components/file_finder/index.vue @@ -2,6 +2,7 @@ import fuzzaldrinPlus from 'fuzzaldrin-plus'; import Mousetrap from 'mousetrap'; import VirtualList from 'vue-virtual-scroll-list'; +import { GlIcon } from '@gitlab/ui'; import Item from './item.vue'; import { UP_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESC_KEY_CODE } from '~/lib/utils/keycodes'; @@ -9,10 +10,11 @@ export const MAX_FILE_FINDER_RESULTS = 40; export const FILE_FINDER_ROW_HEIGHT = 55; export const FILE_FINDER_EMPTY_ROW_HEIGHT = 33; -const originalStopCallback = Mousetrap.stopCallback; +const originalStopCallback = Mousetrap.prototype.stopCallback; export default { components: { + GlIcon, Item, VirtualList, }, @@ -126,7 +128,7 @@ export default { this.focusedIndex = 0; } - Mousetrap.bind(['t', 'command+p', 'ctrl+p'], e => { + Mousetrap.bind(['t', 'mod+p'], e => { if (e.preventDefault) { e.preventDefault(); } @@ -134,7 +136,18 @@ export default { this.toggle(!this.visible); }); - Mousetrap.stopCallback = (e, el, combo) => this.mousetrapStopCallback(e, el, combo); + Mousetrap.prototype.stopCallback = function customStopCallback(e, el, combo) { + if ( + (combo === 't' && el.classList.contains('dropdown-input-field')) || + el.classList.contains('inputarea') + ) { + return true; + } else if (combo === 'mod+p') { + return false; + } + + return originalStopCallback.call(this, e, el, combo); + }; }, methods: { toggle(visible) { @@ -199,18 +212,6 @@ export default { this.cancelMouseOver = false; this.onMouseOver(index); }, - mousetrapStopCallback(e, el, combo) { - if ( - (combo === 't' && el.classList.contains('dropdown-input-field')) || - el.classList.contains('inputarea') - ) { - return true; - } else if (combo === 'command+p' || combo === 'ctrl+p') { - return false; - } - - return originalStopCallback(e, el, combo); - }, }, }; </script> @@ -236,12 +237,13 @@ export default { aria-hidden="true" class="fa fa-search dropdown-input-search" ></i> - <i - :aria-label="__('Clear search input')" + <gl-icon + name="close" + class="dropdown-input-clear" role="button" - class="fa fa-times dropdown-input-clear" + :aria-label="__('Clear search input')" @click="clearSearchInput" - ></i> + /> </div> <div> <virtual-list ref="virtualScrollList" :size="listHeight" :remain="listShowCount" wtag="ul"> diff --git a/app/assets/javascripts/vue_shared/components/file_finder/item.vue b/app/assets/javascripts/vue_shared/components/file_finder/item.vue index 79c62cd9938..4c496ba3f9b 100644 --- a/app/assets/javascripts/vue_shared/components/file_finder/item.vue +++ b/app/assets/javascripts/vue_shared/components/file_finder/item.vue @@ -1,6 +1,6 @@ <script> import fuzzaldrinPlus from 'fuzzaldrin-plus'; -import Icon from '~/vue_shared/components/icon.vue'; +import { GlIcon } from '@gitlab/ui'; import FileIcon from '../file_icon.vue'; import ChangedFileIcon from '../changed_file_icon.vue'; @@ -8,7 +8,7 @@ const MAX_PATH_LENGTH = 60; export default { components: { - Icon, + GlIcon, ChangedFileIcon, FileIcon, }, @@ -103,10 +103,10 @@ export default { <span v-if="file.changed || file.tempFile" v-once class="diff-changed-stats"> <span v-if="showDiffStats"> <span class="cgreen bold"> - <icon name="file-addition" class="align-text-top" /> {{ file.addedLines }} + <gl-icon name="file-addition" class="align-text-top" /> {{ file.addedLines }} </span> <span class="cred bold ml-1"> - <icon name="file-deletion" class="align-text-top" /> {{ file.removedLines }} + <gl-icon name="file-deletion" class="align-text-top" /> {{ file.removedLines }} </span> </span> <changed-file-icon v-else :file="file" /> |