Browse files

MDL-37668 Accessibility: Help popup should be easy to close using key…

…board
  • Loading branch information...
1 parent 9130843 commit 9fb8d1f275643e2198b76921da924b1f74cb6f97 @sammarshallou sammarshallou committed Jan 25, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/javascript-static.js
View
12 lib/javascript-static.js
@@ -1464,7 +1464,7 @@ M.util.help_icon = {
});
this.overlay.render(Y.one(document.body));
- footerbtn.on('click', this.overlay.hide, this.overlay);
+ footerbtn.on('click', this.close, this);
var boundingBox = this.overlay.get("boundingBox");
@@ -1525,8 +1525,14 @@ M.util.help_icon = {
},
display_callback : function(content) {
- content = '<div role="alert">' + content + '</div>';
- this.overlay.set('bodyContent', content);
+ var contentnode, heading;
+ contentnode = Y.Node.create('<div role="alert">' + content + '</div>');
+ this.overlay.set('bodyContent', contentnode);
+ heading = contentnode.one('h1');
+ if (heading) {
+ heading.set('tabIndex', 0);
+ heading.focus();
+ }
},
hideContent : function() {

0 comments on commit 9fb8d1f

Please sign in to comment.