init
This commit is contained in:
commit
a4c68ca9e2
76 changed files with 2737 additions and 0 deletions
16
server/application/backend/static/index.js
Normal file
16
server/application/backend/static/index.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const addDeviceDialog = document.getElementById("add_device_dialog");
|
||||
const openAddDeviceCTA = document.getElementById("add_device");
|
||||
|
||||
// close dialog on backdrop click
|
||||
addDeviceDialog.addEventListener('click', function(event) {
|
||||
var rect = addDeviceDialog.getBoundingClientRect();
|
||||
var isInDialog = (rect.top <= event.clientY && event.clientY <= rect.top + rect.height &&
|
||||
rect.left <= event.clientX && event.clientX <= rect.left + rect.width);
|
||||
if (!isInDialog) {
|
||||
addDeviceDialog.close();
|
||||
}
|
||||
});
|
||||
|
||||
openAddDeviceCTA.addEventListener("click", () => {
|
||||
addDeviceDialog.showModal();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue