@bmlt-enabled/croutonjs 3.24.0 → 3.24.2

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.
package/crouton-gmaps.js CHANGED
@@ -15174,9 +15174,7 @@ var croutonDefaultTemplates = {
15174
15174
  "{{#if this.virtual_meeting_additional_info}}",
15175
15175
  " <div class='meeting-additional-info'>{{this.virtual_meeting_additional_info}}</div>",
15176
15176
  "{{/if}}",
15177
- "<div class='meeting-distance{{#unless this.distance}} hide{{/unless}}' data-id='{{this.id_bigint}}'>",
15178
- "{{getWord 'Distance'}}: {{this.distance}}",
15179
- "</div>",
15177
+ "{{> distance }}"
15180
15178
  ].join('\n'),
15181
15179
 
15182
15180
  metadata_template: [
@@ -17173,6 +17171,19 @@ function Crouton(config) {
17173
17171
  });
17174
17172
  const parent = jQuery('#byfield_distance_in_km tbody');
17175
17173
  if (parent.length == 0) return;
17174
+ if (knt === 0) {
17175
+ parent.children().each(function (index) {
17176
+ if (!this.id) return;
17177
+ const id = this.id.replace("meeting-data-row-", "");
17178
+ const m = self.meetingData.find((m) => m.id_bigint==id);
17179
+ if (!m) return;
17180
+ self.calculateDistance(m);
17181
+ if (m['distance'] != '') {
17182
+ jQuery(this).data('distance', m['distance_in_km']);
17183
+ knt++;
17184
+ }
17185
+ });
17186
+ }
17176
17187
  const sorted = parent.children().sort(function (a, b) {
17177
17188
  const distanceA =parseFloat( jQuery(a).data('distance'));
17178
17189
  const distanceB =parseFloat( jQuery(b).data('distance'));
@@ -18124,6 +18135,10 @@ crouton_Handlebars.registerPartial('offerIcsButton',
18124
18135
  "{{#if (hasBMLT2ics)}}{{> icsButton}}<br/>{{/if}}");
18125
18136
  crouton_Handlebars.registerPartial('directionsButton', hbs_Crouton.templates['directionsButton']);
18126
18137
  crouton_Handlebars.registerPartial('meetingDetailsButton', hbs_Crouton.templates['meetingDetailsButton']);
18138
+ crouton_Handlebars.registerPartial('distance',`
18139
+ <div class='meeting-distance{{#unless this.distance}} hide{{/unless}}' data-id='{{this.id_bigint}}'>
18140
+ {{getWord 'Distance'}}: {{this.distance}}
18141
+ </div>`);
18127
18142
  function convertToPunyCode(str) {
18128
18143
  return str !== undefined ? punycode.toASCII(str.toLowerCase()).replace(/\W|_/g, "-") : "";
18129
18144
  }
@@ -18929,9 +18944,7 @@ function MeetingMap(inConfig) {
18929
18944
  return true;
18930
18945
  };
18931
18946
  function searchResponseCallback(expand = false) {
18932
- if (!gAllMeetings) return;
18933
- if (!gAllMeetings.length) {
18934
- alert ( crouton.localization.getWord("no meetings found") );
18947
+ if (!gAllMeetings || !gAllMeetings.length) {
18935
18948
  return;
18936
18949
  };
18937
18950
  try {