mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-12-22 22:52:54 +00:00
Close project modals when pressing esc
This commit is contained in:
parent
db4f7e5d7a
commit
ae90b40388
1 changed files with 5 additions and 0 deletions
|
@ -68,6 +68,11 @@
|
||||||
$('#close-{{ $index }}').click(function () {
|
$('#close-{{ $index }}').click(function () {
|
||||||
$('#modal-{{ $index }}').removeClass('is-active');
|
$('#modal-{{ $index }}').removeClass('is-active');
|
||||||
});
|
});
|
||||||
|
$(document).keypress(function(e) {
|
||||||
|
if(e.which == 0) {
|
||||||
|
$('#modal-{{ $index }}').removeClass('is-active');
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
{{ end }} {{ end }}
|
{{ end }} {{ end }}
|
||||||
{{ partial "top-icon.html" . }}
|
{{ partial "top-icon.html" . }}
|
||||||
|
|
Loading…
Reference in a new issue