Use keyboard controls with the action buttons

Signed-off-by: Christopher Ng <chrng8@gmail.com>
This commit is contained in:
Christopher Ng 2022-05-27 21:27:24 +00:00
parent 16d2238de5
commit edba92d1f4
3 changed files with 7 additions and 5 deletions

View file

@ -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')

4
dist/core-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long