Skip to content

Commit

Permalink
MDL-37668 Accessibility: Help popup should be easy to close using key…
Browse files Browse the repository at this point in the history
…board
  • Loading branch information
sammarshallou committed Jan 28, 2013
1 parent df93b15 commit e978e6b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/javascript-static.js
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,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");

Expand Down Expand Up @@ -1580,8 +1580,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() {
Expand Down

0 comments on commit e978e6b

Please sign in to comment.