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