From 8c410c9626af9dfcdd431f5988b395565872f51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Sat, 13 May 2023 03:01:28 +0200 Subject: [PATCH] Fix button labels in dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dialog to enter a name for the compressed file is based in a standard "OC.dialogs.prompt", but with some adjustments, like the button labels. The adjustment relies on the whole dialog containing only two buttons (those from the button row), which was true in the past. However, due to the accesibility fixes the dialog now contains an extra button to close the dialog, which alters the expected order of the buttons to modify and causes the labels to be wrongly assigned. To fix that the query to select the buttons to modify is restricted only to those in the button row, which behaves as expected in the whole range of supported versions (from Nextcloud 22 to Nextcloud 27). Signed-off-by: Daniel Calviño Sánchez --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 3c86318..3e0535e 100644 --- a/src/main.js +++ b/src/main.js @@ -88,7 +88,7 @@ import { showError, showSuccess } from '@nextcloud/dialogs' enhancePrompt(suggestedFilename) { const dialog = document.querySelector('.oc-dialog') const input = dialog.querySelector('input[type=text]') - const buttons = dialog.querySelectorAll('button') + const buttons = dialog.querySelectorAll('.oc-dialog-buttonrow button') const icon = dialog.querySelector('.ui-icon') icon.parentNode.removeChild(icon)