Close modal with bg click or escape key
parent
603769d5fd
commit
e54db3c4eb
|
@ -43,3 +43,9 @@ function closeAddRequestModal() {
|
|||
}
|
||||
|
||||
updateTable();
|
||||
|
||||
document.addEventListener("keydown", function onEvent(event) {
|
||||
if (event.key === "Escape") {
|
||||
closeAddRequestModal();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</select>
|
||||
<input type="checkbox" id="allRequests" onchange="updateTable()">View requests in any state</input>
|
||||
</div>
|
||||
<div id="addRequestModalBackground">
|
||||
<div id="addRequestModalBackground" onclick="closeAddRequestModal()">
|
||||
<div id="addRequestModal">
|
||||
<div id="addRequestModalClose"><a href="#" onclick="closeAddRequestModal()">×</a></div>
|
||||
<h1>Add Request</h1>
|
||||
|
|
Loading…
Reference in New Issue