diff --git a/lib/javascript-static.js b/lib/javascript-static.js
index 5e06bc27f9d..ae098c234f1 100644
--- a/lib/javascript-static.js
+++ b/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('
');
+ var hide = Y.Node.create('
');
hide.setAttribute('src', this.get('iconVisible')).on('click', this.updateState, this, true);
- var show = Y.Node.create('
');
+ hide.on('keypress', this.updateStateKey, this, true);
+ var show = Y.Node.create('
');
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, {