diff --git a/app/views/base/layout.scala.html b/app/views/base/layout.scala.html
index a1fee2266d77..ae7492509024 100644
--- a/app/views/base/layout.scala.html
+++ b/app/views/base/layout.scala.html
@@ -50,6 +50,7 @@
ctx.pref.destination ?? "destination",
ctx.blindMode ?? "blind_mode",
"coords_" + ctx.pref.coords).mkString(" ")"
+ data-user="@ctx.userId"
data-piece-set="@ctx.currentPieceSet"
data-sound-dir="@routes.Assets.at("sound")"
data-ports="@portsString"
diff --git a/public/javascripts/big.js b/public/javascripts/big.js
index 9ce427502a05..d007437471e6 100644
--- a/public/javascripts/big.js
+++ b/public/javascripts/big.js
@@ -961,20 +961,22 @@ lichess.storage = {
$('#hamburger').click(function() {
document.body.classList.toggle('fpmenu');
});
- Mousetrap.bind('space', function() {
+ Mousetrap.bind('esc', function() {
$('#hamburger').click();
return false;
});
- if (!lichess.storage.get('ham')) {
- var $help = $('' +
- '← Click the menu icon or press the space key!' +
- '');
- $('#ham-plate').append($help.fadeIn(2000));
- $('#hamburger').click(function() {
- $help.remove();
- lichess.storage.set('ham', 1);
- });
- }
+ (function(key) {
+ if (!lichess.storage.get(key)) {
+ var $help = $('' +
+ '← Click the menu icon or press the <escape> key!' +
+ '');
+ $('#ham-plate').append($help.fadeIn(2000));
+ $('#hamburger').click(function() {
+ $help.remove();
+ lichess.storage.set(key, 1);
+ });
+ }
+ })('ham-' + document.body.getAttribute('data-user'));
});
$.lazy = function(factory) {