Skip to content

Commit

Permalink
start with embedded map when filtering by visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
otrok7 committed Sep 19, 2024
1 parent a0be1b4 commit 79ce828
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 6 additions & 4 deletions croutonjs/meetingMap/js/meeting_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ function MeetingMap(inConfig) {
let dropdownContent = document.getElementById("map-menu-dropdown");
if (dropdownContent.style.display == "inline-block") {
dropdownContent.style.display = "none";
} else
} else {
jQuery("#filteringByVisibility").html(listOnlyVisible?'✔':'');
dropdownContent.style.display = "inline-block";
}
});
[...controlDiv.getElementsByClassName('modal-close')].forEach((elem)=>elem.addEventListener('click', (e)=>closeModalWindow(e.target)));
controlDiv.querySelector("#close_table").addEventListener('click', hideListView);
Expand All @@ -205,7 +207,6 @@ function MeetingMap(inConfig) {
let inDiv = document.getElementById(inDiv_id);
loadMap(inDiv, menuContext, handlebarMapOptions,callback);
loadAllMeetings(meetings_responseObject, fitBounds, true);
if (!config.centerMe && !config.goto) gDelegate.afterInit(()=>filterVisible(config.filter_visible));
};
function loadPopupMap(inDiv_id, meeting, handlebarMapOptions = null) {
if (!gDelegate.isApiLoaded()) {
Expand Down Expand Up @@ -304,6 +305,7 @@ function MeetingMap(inConfig) {
}
searchResponseCallback();
hideThrobber();
if (config.filter_visible || config.centerMe || config.goto) crouton.forceShowMap();
if (config.centerMe) {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(
Expand All @@ -317,9 +319,9 @@ function MeetingMap(inConfig) {
} else if (fitAll) {
showGeocodingDialog();
}
} else if (config.goto) {
} else {
if (!config.centerMe && !config.goto) gDelegate.afterInit(()=>filterVisible(config.filter_visible));
gDelegate.callGeocoder(config.goto, resetVisibleThenFilterMeetingsAndBounds);
if (config.goto) gDelegate.callGeocoder(config.goto, resetVisibleThenFilterMeetingsAndBounds);
}
}
function createCityHash(allMeetings) {
Expand Down
5 changes: 5 additions & 0 deletions croutonjs/src/js/crouton-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,11 @@ Crouton.prototype.render = function(doMeetingMap = false) {
}, !doMeetingMap);
});
});
Crouton.prototype.forceShowMap = function() {
if (self.config.map_page && jQuery('#byfield_embeddedMapPage').hasClass('hide')) {
jQuery('#filterButton_embeddedMapPage').click();
}
}
};


Expand Down

0 comments on commit 79ce828

Please sign in to comment.