Skip to content

Commit

Permalink
Disclosure Examples: Fix Space Bar Bug
Browse files Browse the repository at this point in the history
For issue #311:
1. Update js so space bar now toggles the expanded/collapsed state of the disclosure.
2. Update documentation.
  • Loading branch information
jongund authored and mcking65 committed Mar 12, 2017
1 parent d99821f commit db44c5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions examples/disclosure/disclosure-faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script src="../js/highlight.pack.js"></script>
<script src="../js/app.js"></script>

<!-- js and css for the disclosure example. -->
<link href="css/disclosure-faq.css" rel="stylesheet">
<script src="js/disclosureButton.js" type="text/javascript"></script>

Expand Down
6 changes: 2 additions & 4 deletions examples/disclosure/js/disclosureButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ var ButtonExpand = function (domNode) {
this.domNode = domNode;

this.keyCode = Object.freeze({
'RETURN' : 13,
'SPACE' : 32
'RETURN' : 13
});
};

Expand Down Expand Up @@ -84,8 +83,7 @@ ButtonExpand.prototype.handleKeydown = function (event) {
switch (event.keyCode) {

case this.keyCode.RETURN:
case this.keyCode.SPACE:


this.toggleExpand();

event.stopPropagation();
Expand Down

0 comments on commit db44c5a

Please sign in to comment.