@bmlt-enabled/croutonjs 4.1.3 → 4.1.4

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.
@@ -15280,7 +15280,7 @@ function Crouton(config) {
15280
15280
  self.currentView = "weekday";
15281
15281
  self.distanceTabAllowed = false;
15282
15282
  self.config = {
15283
- version: '4.1.3', // CroutonJS version for debugging
15283
+ version: '4.1.4', // CroutonJS version for debugging
15284
15284
  on_complete: null, // Javascript function to callback when data querying is completed.
15285
15285
  root_server: null, // The root server to use.
15286
15286
  placeholder_id: "bmlt-tabs", // The DOM id that will be used for rendering
@@ -16097,8 +16097,12 @@ function Crouton(config) {
16097
16097
  });
16098
16098
  }
16099
16099
  const sorted = parent.children().sort(function (a, b) {
16100
- const distanceA =parseFloat( jQuery(a).data('distance'));
16101
- const distanceB =parseFloat( jQuery(b).data('distance'));
16100
+ const idA =parseFloat( jQuery(a).data('meetingid').replace("meeting-data-row-", ""));
16101
+ const idB =parseFloat( jQuery(b).data('meetingid').replace("meeting-data-row-", ""));
16102
+ const dataA = self.meetingData.find((m) => m.id_bigint==idA);
16103
+ const dataB = self.meetingData.find((m) => m.id_bigint==idB);
16104
+ const distanceA = dataA ? parseFloat(dataA['distance_in_km']) : Number.POSITIVE_INFINITY;
16105
+ const distanceB = dataB ? parseFloat(dataB['distance_in_km']) : Number.POSITIVE_INFINITY;
16102
16106
  return (distanceA < distanceB) ? -1 : (distanceA > distanceB) ? 1 : 0;
16103
16107
  });
16104
16108
  parent.html(sorted);