Skip to content

Commit

Permalink
Add keyboard accessibility for buttons.
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
arantius committed Sep 9, 2015
1 parent 724bb98 commit 5b2988e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion content/resurrect-select-mirror.xul
Expand Up @@ -29,7 +29,7 @@ window.addEventListener('load', resurrect.loadTarget, false);
</radiogroup>
</groupbox>

<groupbox id='resurrect' onclick='resurrect.clickedXul(event);'>
<groupbox id='resurrect' oncommand='resurrect.clickedXul(event);'>
<caption label='&resurrect.fromMirror;' />

<xul:button
Expand Down
6 changes: 6 additions & 0 deletions content/resurrect.js
Expand Up @@ -56,6 +56,8 @@ var resurrect={
// Add event listener.
contentDoc.getElementById('resurrect').addEventListener(
'click', resurrect.clickedHtml, false);
contentDoc.getElementById('resurrect').addEventListener(
'keypress', resurrect.clickedHtml, false);
}
},

Expand Down Expand Up @@ -121,6 +123,10 @@ var resurrect={
if ('true'==event.target.getAttribute('disabled')) {
return;
}
if ('keypress' == event.type) {
if (event.target.parentNode.id != 'resurrect') return;
if (event.charCode != 32 && event.keyCode != 13) return;
}

return resurrect.clickHandler(
event,
Expand Down

0 comments on commit 5b2988e

Please sign in to comment.