mirror of
https://github.com/ae-utbm/sith.git
synced 2026-05-14 04:58:06 +00:00
Remove some jquery
This commit is contained in:
@@ -125,15 +125,14 @@
|
||||
navbar.style.setProperty("display", current === "none" ? "block" : "none");
|
||||
}
|
||||
|
||||
$(document).keydown(function (e) {
|
||||
if ($(e.target).is('input')) { return }
|
||||
if ($(e.target).is('textarea')) { return }
|
||||
if ($(e.target).is('select')) { return }
|
||||
if (e.keyCode === 83) {
|
||||
$("#search").focus();
|
||||
return false;
|
||||
document.addEventListener("keydown", (e) => {
|
||||
// Looking at the `s` key when not typing in a form
|
||||
if (e.keyCode !== 83 || ["INPUT", "TEXTAREA", "SELECT"].includes(e.target.nodeName)) {
|
||||
return;
|
||||
}
|
||||
});
|
||||
document.getElementById("search").focus();
|
||||
e.preventDefault(); // Don't type the character in the focused search input
|
||||
})
|
||||
</script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user