diff --git a/croutonjs/meetingMap/js/meeting_map.js b/croutonjs/meetingMap/js/meeting_map.js index 78459e7..b2c9083 100644 --- a/croutonjs/meetingMap/js/meeting_map.js +++ b/croutonjs/meetingMap/js/meeting_map.js @@ -329,6 +329,10 @@ function MeetingMap(inConfig) { } } document.getElementsByTagName("BODY")[0].style.overflowX = g_overflowX; + const scrollY = document.body.style.top; + document.getElementsByTagName("BODY")[0].style.position = ''; + document.getElementsByTagName("BODY")[0].style.top = ''; + window.scrollTo(0, parseInt(scrollY || '0') * -1); } var activeModal = null; document.addEventListener("keydown", function(event) { @@ -348,7 +352,10 @@ function MeetingMap(inConfig) { if (dd) dd.style.display = "none"; gDelegate.modalOn(); g_overflowX = document.getElementsByTagName("BODY")[0].style.overflowX; + const newTop = -window.scrollY+'px'; document.getElementsByTagName("BODY")[0].style.overflowX = 'hidden'; + document.getElementsByTagName("BODY")[0].style.position = 'fixed'; + document.getElementsByTagName("BODY")[0].style.top = newTop; } function showFilterDialog(e) { openModalWindow(document.getElementById('filter_modal')); diff --git a/croutonjs/src/js/crouton-core.js b/croutonjs/src/js/crouton-core.js index ea3e7d1..0e907b4 100644 --- a/croutonjs/src/js/crouton-core.js +++ b/croutonjs/src/js/crouton-core.js @@ -67,6 +67,7 @@ function Crouton(config) { has_meeting_count: false, // Shows the meeting count show_distance: false, // Determines distance on page load distance_search: 0, // Makes a distance based search with results either number of / or distance from coordinates + force_service_body_parents: false, // Always get the service body parent data recurse_service_bodies: false,// Recurses service bodies when making service bodies request service_body: [], // Array of service bodies to return data for. formats: '', // Return only meetings with these formats (format shared-id, not key-string) @@ -123,6 +124,7 @@ function Crouton(config) { self.config.refresh_map=1; self.config.show_map = 1; self.reset(); + self.config.force_service_body_parents = true; self.render(); /* croutonMap.reload(self.meetingData); @@ -559,7 +561,7 @@ function Crouton(config) { }); } self.getServiceBodies = function(service_bodies_id) { - var requires_parents = self.config.has_regions; + var requires_parents = self.config.has_regions || self.config.force_service_body_parents; var url = this.config['root_server'] + '/client_interface/jsonp/?switcher=GetServiceBodies' + (requires_parents ? '&parents=1' : '') + getServiceBodiesQueryString(service_bodies_id); @@ -1059,7 +1061,7 @@ Crouton.prototype.meetingModal = function(meetingId) { mm.getElementsByClassName('modal-left').item(0).addEventListener("click", ev=>doSwipe("right")); } if (index >= visibleMeetings.length-1) { - jQuery(".modal-left").addClass("hide"); + jQuery(".modal-right").addClass("hide"); } else { mm.getElementsByClassName('modal-right').item(0).addEventListener("click", ev=>doSwipe("left")); }