Update external-map.js
Handle situations when main window loose focus - e.g. by selecting of differen browser tab.
This commit is contained in:
committed by
Maximilian Krög
parent
7bed63bf3f
commit
f74cd62827
@@ -71,5 +71,19 @@ button.addEventListener('click', function () {
|
||||
// Close window in case user does a page reload
|
||||
closeMapWindow();
|
||||
});
|
||||
|
||||
window.addEventListener('blur', function (evt) {
|
||||
externalMapTarget.style.opacity=0.3;
|
||||
});
|
||||
|
||||
window.addEventListener('focus', function (evt) {
|
||||
externalMapTarget.style.opacity=1.0;
|
||||
});
|
||||
|
||||
mapWindow.addEventListener('focus', function (evt) {
|
||||
if (!window.document.hidden){
|
||||
externalMapTarget.style.opacity=1.0;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user