Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix button labels in dialog
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 <[email protected]>
  • Loading branch information
danxuliu committed May 13, 2023
commit 8c410c9626af9dfcdd431f5988b395565872f51e
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down