]> git.mxchange.org Git - friendica.git/commitdiff
[frio] Accessibility: enable keyboard action on visibility panels in compose page
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 15 Jul 2019 02:48:39 +0000 (22:48 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 30 Jul 2019 00:31:48 +0000 (20:31 -0400)
view/templates/item/compose-footer.tpl

index dc55cd9e4eb38d159129e26f32cbdb7d38328a5b..697be6fd10c2d8f3b5ad329dcbe9411acc06df16 100644 (file)
                                e.stopPropagation()
                        }
                });
+               // Accessibility: enable space and enter to open a panel when focused
+               $('body').on('keyup', '[data-toggle="collapse"]:focus', function (e) {
+                       if (e.key === ' ' || e.key === 'Enter') {
+                               $(this).click();
+                               e.preventDefault();
+                               e.stopPropagation();
+                       }
+               });
 
                $('#visibility-public-panel').on('show.bs.collapse', function() {
                        $('#visibility-public').prop('checked', true);