Close modal with bg click or escape key
This commit is contained in:
		
							parent
							
								
									603769d5fd
								
							
						
					
					
						commit
						e54db3c4eb
					
				
					 2 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue