From 0fcab30629edd4948479ea52645a5686839bda8f Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 30 May 2021 17:00:15 +0200 Subject: [PATCH] Reorder --- .../quick-actions/quick-actions.vue | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index 1a4ef714e..2594e9e2f 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -201,35 +201,6 @@ export default { break } }, - select(parentIndex, index) { - - if (index < 0 && parentIndex === 0) { - this.$refs.searchInput.focus() - return - } - - if (index < 0) { - parentIndex-- - index = this.results[parentIndex].items.length - 1 - } - - let elems = this.$refs[`result-${parentIndex}_${index}`] - - if (this.results[parentIndex].items.length === index) { - elems = this.$refs[`result-${parentIndex + 1}_0`] - } - - if (typeof elems === 'undefined' || elems.length === 0) { - return - } - - if (Array.isArray(elems)) { - elems[0].focus() - return - } - - elems.focus() - }, doCmd() { if (this.selectedCmd === null) { return @@ -284,6 +255,35 @@ export default { this.error(e, this) }) }, + select(parentIndex, index) { + + if (index < 0 && parentIndex === 0) { + this.$refs.searchInput.focus() + return + } + + if (index < 0) { + parentIndex-- + index = this.results[parentIndex].items.length - 1 + } + + let elems = this.$refs[`result-${parentIndex}_${index}`] + + if (this.results[parentIndex].items.length === index) { + elems = this.$refs[`result-${parentIndex + 1}_0`] + } + + if (typeof elems === 'undefined' || elems.length === 0) { + return + } + + if (Array.isArray(elems)) { + elems[0].focus() + return + } + + elems.focus() + }, }, }