Skip to content

Commit

Permalink
add service body parent to crouton_map default values
Browse files Browse the repository at this point in the history
  • Loading branch information
otrok7 committed Aug 19, 2024
1 parent 2ae74f0 commit 2699b26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions croutonjs/meetingMap/js/meeting_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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'));
Expand Down
6 changes: 4 additions & 2 deletions croutonjs/src/js/crouton-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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"));
}
Expand Down

0 comments on commit 2699b26

Please sign in to comment.