@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.
@@ -15171,9 +15171,7 @@ var croutonDefaultTemplates = {
15171
15171
  "{{#if this.virtual_meeting_additional_info}}",
15172
15172
  " <div class='meeting-additional-info'>{{this.virtual_meeting_additional_info}}</div>",
15173
15173
  "{{/if}}",
15174
- "<div class='meeting-distance{{#unless this.distance}} hide{{/unless}}' data-id='{{this.id_bigint}}'>",
15175
- "{{getWord 'Distance'}}: {{this.distance}}",
15176
- "</div>",
15174
+ "{{> distance }}"
15177
15175
  ].join('\n'),
15178
15176
 
15179
15177
  metadata_template: [
@@ -17170,6 +17168,19 @@ function Crouton(config) {
17170
17168
  });
17171
17169
  const parent = jQuery('#byfield_distance_in_km tbody');
17172
17170
  if (parent.length == 0) return;
17171
+ if (knt === 0) {
17172
+ parent.children().each(function (index) {
17173
+ if (!this.id) return;
17174
+ const id = this.id.replace("meeting-data-row-", "");
17175
+ const m = self.meetingData.find((m) => m.id_bigint==id);
17176
+ if (!m) return;
17177
+ self.calculateDistance(m);
17178
+ if (m['distance'] != '') {
17179
+ jQuery(this).data('distance', m['distance_in_km']);
17180
+ knt++;
17181
+ }
17182
+ });
17183
+ }
17173
17184
  const sorted = parent.children().sort(function (a, b) {
17174
17185
  const distanceA =parseFloat( jQuery(a).data('distance'));
17175
17186
  const distanceB =parseFloat( jQuery(b).data('distance'));
@@ -18121,6 +18132,10 @@ crouton_Handlebars.registerPartial('offerIcsButton',
18121
18132
  "{{#if (hasBMLT2ics)}}{{> icsButton}}<br/>{{/if}}");
18122
18133
  crouton_Handlebars.registerPartial('directionsButton', hbs_Crouton.templates['directionsButton']);
18123
18134
  crouton_Handlebars.registerPartial('meetingDetailsButton', hbs_Crouton.templates['meetingDetailsButton']);
18135
+ crouton_Handlebars.registerPartial('distance',`
18136
+ <div class='meeting-distance{{#unless this.distance}} hide{{/unless}}' data-id='{{this.id_bigint}}'>
18137
+ {{getWord 'Distance'}}: {{this.distance}}
18138
+ </div>`);
18124
18139
  function convertToPunyCode(str) {
18125
18140
  return str !== undefined ? punycode.toASCII(str.toLowerCase()).replace(/\W|_/g, "-") : "";
18126
18141
  }
@@ -18926,9 +18941,7 @@ function MeetingMap(inConfig) {
18926
18941
  return true;
18927
18942
  };
18928
18943
  function searchResponseCallback(expand = false) {
18929
- if (!gAllMeetings) return;
18930
- if (!gAllMeetings.length) {
18931
- alert ( crouton.localization.getWord("no meetings found") );
18944
+ if (!gAllMeetings || !gAllMeetings.length) {
18932
18945
  return;
18933
18946
  };
18934
18947
  try {