From 52a1748a0b5663a3e6acaa68ae8ed082f226a502 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Tue, 1 Aug 2023 11:43:13 +0200 Subject: move long click handlers into methods Signed-off-by: Julien Veyssier (cherry picked from commit 577640663b649836731ea4fb2ab60f6b6e156553) --- apps/settings/src/components/AdminAI.vue | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'apps/settings') diff --git a/apps/settings/src/components/AdminAI.vue b/apps/settings/src/components/AdminAI.vue index 70c9c548615..51e5c5cede6 100644 --- a/apps/settings/src/components/AdminAI.vue +++ b/apps/settings/src/components/AdminAI.vue @@ -4,9 +4,9 @@ :description="t('settings', 'Machine translation can be implemented by different apps. Here you can define the precedence of the machine translation apps you have installed at the moment.')">
- {{ i+1 }} {{ translationProviders.find(p => p.class === providerClass)?.name }} - - + {{ i + 1 }} {{ translationProviders.find(p => p.class === providerClass)?.name }} + +
@@ -96,6 +96,22 @@ export default { } }, methods: { + moveUp(i) { + this.settings['ai.translation_provider_preferences'].splice( + Math.min(i - 1, 0), + 0, + ...this.settings['ai.translation_provider_preferences'].splice(i, 1) + ) + this.saveChanges() + }, + moveDown(i) { + this.settings['ai.translation_provider_preferences'].splice( + i + 1, + 0, + ...this.settings['ai.translation_provider_preferences'].splice(i, 1) + ) + this.saveChanges() + }, async saveChanges() { this.loading = true const data = { settings: this.settings } -- cgit v1.2.3