@bmlt-enabled/croutonjs 3.18.3 → 3.18.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16415,6 +16415,10 @@ function Crouton(config) {
16415
16415
  self.updateMeetingCount = function(showingNow=null) {
16416
16416
  self = this;
16417
16417
  let meetingCount = self.meetingData.length;
16418
+ if (self.meetingCountCallback) self.meetingCountCallback(meetingCount);
16419
+ if (self.groupCountCallback) self.groupCountCallback(
16420
+ arrayUnique(self.meetingData.map((m)=>m['worldid_mixed'] !== "" ? m['worldid_mixed'] :m['meeting_name'])).length
16421
+ );
16418
16422
  addLive = function(id) {return id+", "+id+"-live"};
16419
16423
  if (showingNow !== null) {
16420
16424
  meetingCount = showingNow.length;
@@ -16560,6 +16564,14 @@ function Crouton(config) {
16560
16564
  croutonMap.loadPopupMap("bmlt-handlebars-map", meetingDetailsData, self.handlebarMapOptions);
16561
16565
  }
16562
16566
  }
16567
+ self.meetingCountCallback = null;
16568
+ self.grouoCountCallback = null;
16569
+ Crouton.prototype.meetingCount = function(f) {
16570
+ self.meetingCountCallback = f;
16571
+ }
16572
+ Crouton.prototype.groupCount = function(f) {
16573
+ self.groupCountCallback = f;
16574
+ }
16563
16575
  Crouton.prototype.filterNext24 = function(filterNow = true) {
16564
16576
  if (!filterNow) {
16565
16577
  jQuery("#filter-dropdown-next24").val('a-');
@@ -16772,7 +16784,7 @@ function Crouton(config) {
16772
16784
  }
16773
16785
  return 'bmlt-map';
16774
16786
  }
16775
- if ((self.config['show_map'] || self.config['map_search']) && (typeof window.croutonMap === 'undefined')) {
16787
+ if (typeof window.croutonMap === 'undefined') {
16776
16788
  window.croutonMap = new MeetingMap(self.config);
16777
16789
  if (self.config['map_search']) self.searchMap();
16778
16790
  }
@@ -17251,7 +17263,10 @@ Crouton.prototype.render = function(doMeetingMap = false) {
17251
17263
  jQuery("#bmlt-map").removeClass("hide");
17252
17264
  }
17253
17265
  if (self.config['map_page'] && !doMeetingMap) {
17254
- croutonMap.initialize('byfield_embeddedMapPage', self.meetingData);
17266
+ if (self.meetingData.filter(m => m.venue_type != 2).length==0) {
17267
+ jQuery('#filterButton_embeddedMapPage').addClass('hide');
17268
+ }
17269
+ else croutonMap.initialize('byfield_embeddedMapPage', self.meetingData);
17255
17270
  }
17256
17271
  if (self.config['refresh_map']) {
17257
17272
  croutonMap.refreshMeetings(self.meetingData, true, true);
@@ -18026,6 +18041,7 @@ function MeetingMap(inConfig) {
18026
18041
  return true;
18027
18042
  };
18028
18043
  function searchResponseCallback(expand = false) {
18044
+ if (!gAllMeetings) return;
18029
18045
  if (!gAllMeetings.length) {
18030
18046
  alert ( crouton.localization.getWord("no meetings found") );
18031
18047
  return;
@@ -18277,6 +18293,7 @@ function MeetingMap(inConfig) {
18277
18293
  return;
18278
18294
  }
18279
18295
  gDelegate.invalidateSize();
18296
+ if (!gAllMeetings) return;
18280
18297
  gDelegate.fitBounds(
18281
18298
  ((gMeetingIdsFromCrouton) ? gAllMeetings.filter((m) => gMeetingIdsFromCrouton.includes(m.id_bigint)) : gAllMeetings)
18282
18299
  .reduce(function(a,m) {a.push([m.latitude, m.longitude]); return a;},[])
@@ -18680,10 +18697,10 @@ function addControl(div,pos,cb) {
18680
18697
  });
18681
18698
  }
18682
18699
  function modalOn() {
18683
- gMainMap.dragging.disable()
18700
+ if (gMainMap) gMainMap.dragging.disable()
18684
18701
  }
18685
18702
  function modalOff() {
18686
- gMainMap.dragging.enable()
18703
+ if (gMainMap) gMainMap.dragging.enable()
18687
18704
  }
18688
18705
  function returnTrue() {return true;}
18689
18706
  this.createMap = createMap;