Trigger upload actions only for Enter & Space keys

Signed-off-by: Kevin Ndung'u <kevgathuku@gmail.com>
This commit is contained in:
Kevin Ndung'u 2018-07-21 20:30:58 +03:00 committed by Daniel Calviño Sánchez
parent d06e00ffe3
commit 1cdf808197
1 changed files with 4 additions and 2 deletions

View File

@ -237,8 +237,10 @@
OC.Util.scaleFixForIE8(this.$('.svg')); OC.Util.scaleFixForIE8(this.$('.svg'));
// Trigger upload action also with keyboard navigation on enter // Trigger upload action also with keyboard navigation on enter
this.$el.find('[for="file_upload_start"]').on('keypress', function() { this.$el.find('[for="file_upload_start"]').on('keyup', function(event) {
$('#file_upload_start').trigger('click'); if (event.key === " " || event.key === "Enter") {
$('#file_upload_start').trigger('click');
}
}); });
}, },