From 9759400751cf9fe291d8b006617808fdd633fc64 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 31 Dec 2016 19:13:35 +0000 Subject: [PATCH] updates --- _embed/public/js/common.js | 16 +++++++++++++++- _embed/templates/base.tmpl | 22 ++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/_embed/public/js/common.js b/_embed/public/js/common.js index 678264c2..94804a69 100644 --- a/_embed/public/js/common.js +++ b/_embed/public/js/common.js @@ -108,7 +108,7 @@ var removeLastDirectoryPartOf = function(url) { * * * * * * * * * * * * * * * * * */ function closePrompt(event) { - let prompt = document.querySelector('.prompt'); + let prompt = document.querySelector('.prompt:not(.help)'); event.preventDefault(); document.querySelector('.overlay').classList.remove('active'); @@ -350,6 +350,20 @@ function setupSearch() { searchInput.addEventListener('keyup', searchEvent); } +function closeHelp() { + document.querySelector('.help').classList.remove('active'); + document.querySelector('.overlay').classList.remove('active'); +} + +document.addEventListener('keydown', (event) => { + if (event.keyCode == 112) { + event.preventDefault(); + + document.querySelector('.help').classList.add('active'); + document.querySelector('.overlay').classList.add('active'); + } +}); + /* * * * * * * * * * * * * * * * * * * BOOTSTRAP * diff --git a/_embed/templates/base.tmpl b/_embed/templates/base.tmpl index db200104..e6f229b4 100644 --- a/_embed/templates/base.tmpl +++ b/_embed/templates/base.tmpl @@ -13,8 +13,6 @@ {{- end -}} - -