summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-05-27 21:27:24 +0000
committerChristopher Ng <chrng8@gmail.com>2022-06-09 00:13:52 +0000
commitedba92d1f4bc9de0c3efff860aead3587b587374 (patch)
treed1cb4e5f6e06ea5cb0c46ba133e986b65b92b41f /core
parent16d2238de55bc551d14af597468765e98b5fb1eb (diff)
downloadnextcloud-server-edba92d1f4bc9de0c3efff860aead3587b587374.tar.gz
nextcloud-server-edba92d1f4bc9de0c3efff860aead3587b587374.zip
Use keyboard controls with the action buttons
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/src/jquery/ocdialog.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/src/jquery/ocdialog.js b/core/src/jquery/ocdialog.js
index 312e52395da..91466f6fec5 100644
--- a/core/src/jquery/ocdialog.js
+++ b/core/src/jquery/ocdialog.js
@@ -141,8 +141,10 @@ $.widget('oc.ocdialog', {
self.$defaultButton = $button
}
self.$buttonrow.append($button)
- $button.click(function() {
- val.click.apply(self.element[0], arguments)
+ $button.on('click keydown', function(event) {
+ if (event.type === 'click' || (event.type === 'keydown' && event.key === 'Enter')) {
+ val.click.apply(self.element[0], arguments)
+ }
})
})
this.$buttonrow.find('button')