exit search screen with Esc key (#2055)

* exit search with esc key feature is added
* closing search screen with esc key feature is added to _main.js
This commit is contained in:
safaer
2019-02-12 00:00:14 +03:00
committed by Michael Rose
parent 8eb880aaa0
commit 1e78b160ca
3 changed files with 12 additions and 2 deletions

View File

@@ -43,6 +43,16 @@ $(document).ready(function() {
$(".author__urls-wrapper button").toggleClass("open");
});
// Close search screen with Esc key
$(document).keyup(function(e) {
if (e.keyCode === 27) {
if ($(".initial-content").hasClass("is--hidden")) {
$(".search-content").toggleClass("is--visible");
$(".initial-content").toggleClass("is--hidden");
}
}
});
// Search toggle
$(".search__toggle").on("click", function() {
$(".search-content").toggleClass("is--visible");

2
assets/js/main.min.js vendored Normal file → Executable file

File diff suppressed because one or more lines are too long