1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

Force blur event on enter in search field, which will update the URI

This commit is contained in:
Stephen Asbury 2019-06-18 17:08:28 -07:00
parent 9566ae2cbc
commit 3c4cf56b45

View File

@ -90,6 +90,16 @@
window.gitbook.events.bind("page.change", function () { window.gitbook.events.bind("page.change", function () {
pageChanged(); pageChanged();
}); });
var searchInput = document.querySelector('#book-search-input input');
if (searchInput) {
searchInput.addEventListener('keyup', function(event) {
if (event.keyCode === 13) {
event.target.blur();
}
});
}
} }
function pageChanged() { function pageChanged() {