@raruto/leaflet-elevation 1.9.0 → 1.9.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raruto/leaflet-elevation",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "A Leaflet plugin that allows to add elevation profiles using d3js",
5
5
  "main": "dist/leaflet-elevation.min.js",
6
6
  "module": "src/index.js",
package/src/control.js CHANGED
@@ -17,7 +17,7 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
17
17
  __TOGEOJSON: 'https://unpkg.com/@tmcw/togeojson@4.5.0/dist/togeojson.umd.js',
18
18
  __LGEOMUTIL: 'https://unpkg.com/leaflet-geometryutil@0.9.3/src/leaflet.geometryutil.js',
19
19
  __LALMOSTOVER: 'https://unpkg.com/leaflet-almostover@1.0.1/src/leaflet.almostover.js',
20
- __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.0/libs/leaflet-distance-marker.min.js',
20
+ __LDISTANCEM: 'https://unpkg.com/@raruto/leaflet-elevation@1.9.1/libs/leaflet-distance-marker.min.js',
21
21
 
22
22
  /*
23
23
  * Add data to the diagram either from GPX or GeoJSON and update the axis domain and data
@@ -1147,12 +1147,13 @@ export const Elevation = L.Control.Elevation = L.Control.extend({
1147
1147
  this._summary._container.innerHTML += '<span class="download"><a href="#">' + L._('Download') + '</a></span>'
1148
1148
  _.select('.download a', this._summary._container).onclick = (e) => {
1149
1149
  e.preventDefault();
1150
- if (e.downloadLink == 'modal' && typeof CustomEvent === "function") {
1151
- document.dispatchEvent(new CustomEvent("eletrack_download", { detail: e }));
1152
- } else if (e.downloadLink == 'link' || e.downloadLink === true) {
1153
- e.confirm();
1150
+ let event = { downloadLink: this.options.downloadLink, confirm: _.saveFile.bind(this, this._downloadURL) };
1151
+ if (this.options.downloadLink == 'modal' && typeof CustomEvent === "function") {
1152
+ document.dispatchEvent(new CustomEvent("eletrack_download", { detail: event }));
1153
+ } else if (this.options.downloadLink == 'link' || this.options.downloadLink === true) {
1154
+ event.confirm();
1154
1155
  }
1155
- this._fireEvt('eletrack_download', { downloadLink: this.options.downloadLink, confirm: _.saveFile.bind(this, this._downloadURL) });
1156
+ this._fireEvt('eletrack_download', event);
1156
1157
  };
1157
1158
  };
1158
1159
  },