1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-07 07:16:51 +02:00

Add @marcus-herrmann PR #1 which improves keyboard accessibility of ProcessPageList, enabling use of spacebar to toggle actions open/closed.

This commit is contained in:
Ryan Cramer
2016-10-05 10:38:45 -04:00
parent ad5f79559a
commit 3267e6ad68
3 changed files with 17 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ of contributions in different repositories. Please review the instructions for e
## Pull Requests (PRs) ## Pull Requests (PRs)
- Pull requests should be submitted to the [processwire](https://github.com/processwire/processwire/pulls) - Pull requests should be submitted to the [processwire](https://github.com/processwire/processwire/pulls)
repository. repository, and based on the [dev branch](https://github.com/processwire/processwire/tree/dev).
- Before submitting a PR, read the Contributor License Agreement (CLA) at - Before submitting a PR, read the Contributor License Agreement (CLA) at
<https://processwire.com/about/license/cla/> and indicate your agreement (electronic signature) <https://processwire.com/about/license/cla/> and indicate your agreement (electronic signature)
@@ -63,8 +63,6 @@ of contributions in different repositories. Please review the instructions for e
before submitting a PR. While it's not required that you adhere to the style guide, it does increase before submitting a PR. While it's not required that you adhere to the style guide, it does increase
the odds that we may be able to directly merge your PR. the odds that we may be able to directly merge your PR.
- Please base pull requests off of the latest ProcessWire 3.x development (dev) branch.
- Please only submit code that you feel confident is stable and you have thoroughly tested. - Please only submit code that you feel confident is stable and you have thoroughly tested.
Verbose code comments are also appreciated when possible. Verbose code comments are also appreciated when possible.

View File

@@ -203,6 +203,21 @@ $(document).ready(function() {
}); });
} }
} }
$(document).on('keydown', '.PageListItem', function(e) {
// PR#1 makes page-list keyboard accessible
e = e || window.event;
if(e.keyCode == 0 || e.keyCode == 32) {
// spacebar
var $actions = $(this).find('.PageListActions');
if($actions.is(":visible")) {
$actions.css('display', 'none');
} else {
$actions.css('display', 'inline-block');
}
return false;
}
});
$(document).on('mouseover', '.PageListItem', function(e) { $(document).on('mouseover', '.PageListItem', function(e) {

File diff suppressed because one or more lines are too long