Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'wip-MDL-27429-m21' of git://github.com/Beedell/moodle i…

…nto MOODLE_21_STABLE
  • Loading branch information...
commit a8361fc2146c1ebe81fb714439afc8983ee5ce0f 2 parents 96c7aa3 + 5a062fc
@samhemelryk samhemelryk authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 lib/javascript-static.js
View
11 lib/javascript-static.js
@@ -617,10 +617,12 @@ M.util.init_block_hider = function(Y, config) {
t = b.one('.title'),
a = null;
if (t && (a = t.one('.block_action'))) {
- var hide = Y.Node.create('<img class="block-hider-hide" alt="'+config.tooltipVisible+'" title="'+config.tooltipVisible+'" />');
+ var hide = Y.Node.create('<img class="block-hider-hide" tabindex="0" alt="'+config.tooltipVisible+'" title="'+config.tooltipVisible+'" />');
hide.setAttribute('src', this.get('iconVisible')).on('click', this.updateState, this, true);
- var show = Y.Node.create('<img class="block-hider-show" alt="'+config.tooltipHidden+'" title="'+config.tooltipHidden+'" />');
+ hide.on('keypress', this.updateStateKey, this, true);
+ var show = Y.Node.create('<img class="block-hider-show" tabindex="0" alt="'+config.tooltipHidden+'" title="'+config.tooltipHidden+'" />');
show.setAttribute('src', this.get('iconHidden')).on('click', this.updateState, this, false);
+ show.on('keypress', this.updateStateKey, this, false);
a.insert(show, 0).insert(hide, 0);
}
},
@@ -631,6 +633,11 @@ M.util.init_block_hider = function(Y, config) {
} else {
this.get('block').removeClass('hidden');
}
+ },
+ updateStateKey : function(e, hide) {
+ if (e.keyCode == 13) { //allow hide/show via enter key
+ this.updateState(this, hide);
+ }
}
};
Y.extend(blockhider, Y.Base, blockhider.prototype, {
Please sign in to comment.
Something went wrong with that request. Please try again.