Skip to content

Commit

Permalink
Fix bug loading maps behind static maps
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Nov 28, 2023
1 parent 293eddc commit f384bf5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion freesound/static/bw-frontend/src/utils/initHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ const initializeStuffInContainer = (container, bindModals, activateModals) => {
// Init maps (note that already initialized maps won't be re-initialized)
const maps = document.getElementsByClassName('map');
maps.forEach(map => {
initMap(map);
const staticMapWrapper = document.getElementById('static_map_wrapper');
const mapIsBehindStaticMap = staticMapWrapper !== null && staticMapWrapper.parentNode == map.parentNode;
if (map.id !== 'static_map_wrapper' && !mapIsBehindStaticMap){
// Only initialize non-static maps and maps which are not behind a static map (as those will be initialized when user clicks)
initMap(map);
}
});
}

Expand Down

0 comments on commit f384bf5

Please sign in to comment.