-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
29 lines (24 loc) · 951 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
document.addEventListener('DOMContentLoaded', function() {
let mapImageButton = document.getElementById('mapImageButton')
let dataButton = document.getElementById('dataButton')
let mapImage = document.getElementById('mapImage')
let iframeContainer = document.getElementById('iframeContainer')
let dataFrame = document.getElementById('dataFrame')
let spinner = document.getElementById('spinnerOverlay')
dataFrame.addEventListener('load', function() {
// hide spinner
spinner.className = "hidden"
}, false)
mapImageButton.addEventListener('click', function() {
mapImage.className = ""
iframeContainer.className = "hidden"
}, false)
dataButton.addEventListener('click', function() {
mapImage.className = "hidden"
iframeContainer.className = ""
console.log(dataFrame.src)
if(!dataFrame.src){
dataFrame.src = "http://ias.openhealth.fr/en-gb/carteallergies"
}
}, false)
}, false)