ictgj-voting/assets/js/gjvote.js

18 lines
363 B
JavaScript
Raw Normal View History

2017-06-08 17:20:43 +00:00
function toggleAdminPanel() {
document.querySelector('#menu').classList.toggle('hidden');
2017-04-21 18:17:18 +00:00
}
document.onkeydown = function(evt) {
evt = evt || window.event;
var isEscape = false;
if("key" in evt) {
isEscape = (evt.key == "Escape" || evt.key == "Esc");
} else {
isEscape = (evt.keyCode == 27);
}
if(isEscape) {
2017-06-08 17:20:43 +00:00
toggleAdminPanel();
2017-04-21 18:17:18 +00:00
}
}