mirror of https://github.com/rails/rails
Merge pull request #43113 from intrip/hide-guides-with-escape
Close guides dropdown with Escape keypress
This commit is contained in:
commit
7f593b6052
|
@ -41,6 +41,12 @@
|
|||
});
|
||||
});
|
||||
|
||||
document.addEventListener("keyup", function(e) {
|
||||
if (e.key === "Escape" && guides.classList.contains("visible")) {
|
||||
guides.classList.remove("visible");
|
||||
}
|
||||
});
|
||||
|
||||
var guidesIndexItem = document.querySelector("select.guides-index-item");
|
||||
var currentGuidePath = window.location.pathname;
|
||||
guidesIndexItem.value = currentGuidePath.substring(currentGuidePath.lastIndexOf("/") + 1);
|
||||
|
|
Loading…
Reference in New Issue