commit ac31a9d597d62750164e84a3ae3c9c6fbd6b6eb5
parent f66de11a305a81a994a5c7bf598fce1bed45fbc7
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Mon, 6 Jan 2020 22:47:10 +0100
fix lint errors (consistent-this)
Diffstat:
5 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/lib/leaflet.control.elevation-profile/index.js b/src/lib/leaflet.control.elevation-profile/index.js
@@ -160,12 +160,12 @@ var DragEvents = L.Class.extend({
},
onMouseMove: function(e) {
- var i, button, self = this;
+ var i, button, that = this;
function exceedsTolerance(button) {
- var tolerance = self.options.dragTolerance;
- return Math.abs(e.clientX - self.dragStartPos[button].clientX) > tolerance ||
- Math.abs(e.clientY - self.dragStartPos[button].clientY) > tolerance;
+ var tolerance = that.options.dragTolerance;
+ return Math.abs(e.clientX - that.dragStartPos[button].clientX) > tolerance ||
+ Math.abs(e.clientY - that.dragStartPos[button].clientY) > tolerance;
}
var dragButtons = this.options.dragButtons;
@@ -186,7 +186,7 @@ var DragEvents = L.Class.extend({
this.eventsTarget.fire('drag', L.extend({
dragButton: button,
origEvent: e,
- startEvent: self.dragStartPos[button]
+ startEvent: that.dragStartPos[button]
}, offestFromEvent(e), movementFromEvents(this.prevEvent[button], e)
)
);
@@ -231,19 +231,19 @@ const ElevationProfile = L.Class.extend({
notify('Track is empty');
return;
}
- var self = this;
+ var that = this;
this.horizZoom = 1;
this.dragStart = null;
this._getElevation(samples)
.then(function(values) {
- self.values = values;
- self._addTo(map);
+ that.values = values;
+ that._addTo(map);
}
)
.catch((e) => {
logging.captureException(e, 'error getting elevation');
notify(`Failed to get elevation data: ${e.message}`);
- self._addTo(map);
+ that._addTo(map);
});
this.values = null;
},
diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js
@@ -494,9 +494,9 @@ L.Control.TrackList = L.Control.extend({
},
reverseTrack: function(track) {
- var self = this;
+ var that = this;
this.getTrackPolylines(track).forEach(function(trackSegment) {
- self.reverseTrackSegment(trackSegment);
+ that.reverseTrackSegment(trackSegment);
}
);
},
@@ -806,9 +806,9 @@ L.Control.TrackList = L.Control.extend({
this.map.on('click', this.stopLineJoinSelection, this);
L.DomUtil.addClass(this.map.getContainer(), 'join-line-selecting');
L.DomEvent.on(document, 'keyup', this.onEscPressedStopLineJoinSelection, this);
- var self = this;
+ var that = this;
setTimeout(function() {
- self._editedLine.preventStopEdit = true;
+ that._editedLine.preventStopEdit = true;
}, 0
);
},
@@ -887,9 +887,9 @@ L.Control.TrackList = L.Control.extend({
L.DomEvent.off(document, 'keyup', this.onEscPressedStopLineJoinSelection, this);
this.map.removeLayer(this._lineJoinCursor);
this._lineJoinCursor = null;
- var self = this;
+ var that = this;
setTimeout(function() {
- self._editedLine.preventStopEdit = false;
+ that._editedLine.preventStopEdit = false;
}, 0
);
}
@@ -1110,10 +1110,10 @@ L.Control.TrackList = L.Control.extend({
},
exportTracks: function(minTicksIntervalMeters) {
- var self = this;
+ var that = this;
return this.tracks()
.filter(function(track) {
- return self.getTrackPolylines(track).length;
+ return that.getTrackPolylines(track).length;
}
)
.map(function(track) {
diff --git a/src/lib/leaflet.fixes/index.js b/src/lib/leaflet.fixes/index.js
@@ -87,8 +87,8 @@ function addTooltipDelay() {
const origOpenTooltip = L.Layer.prototype._openTooltip;
L.Layer.prototype._openTooltip = function(e) {
if (this._tooltip.options.delay) {
- const self = this;
- this._pendingTooltip = setTimeout(() => origOpenTooltip.call(self, e), this._tooltip.options.delay);
+ const that = this;
+ this._pendingTooltip = setTimeout(() => origOpenTooltip.call(that, e), this._tooltip.options.delay);
} else {
origOpenTooltip.call(this, e);
}
diff --git a/src/lib/leaflet.layer.bing/index.js b/src/lib/leaflet.layer.bing/index.js
@@ -49,7 +49,7 @@ const BingLayer = L.TileLayer.extend({
return;
}
this.metaRequested = true;
- var _this = this;
+ var that = this;
var cbid = '_bing_metadata_' + L.Util.stamp(this);
window[cbid] = function (meta) {
window[cbid] = undefined;
@@ -58,7 +58,7 @@ const BingLayer = L.TileLayer.extend({
if (meta.errorDetails) {
throw new Error(meta.errorDetails);
}
- _this.initMetadata(meta);
+ that.initMetadata(meta);
};
var urlScheme = 'https';
var url = urlScheme + '://dev.virtualearth.net/REST/v1/Imagery/Metadata/'
diff --git a/src/lib/leaflet.polyline-measure/index.js b/src/lib/leaflet.polyline-measure/index.js
@@ -90,11 +90,11 @@ L.MeasuredLine = L.Polyline.extend({
var steps = [500, 1000, 2000, 5000, 10000, 20000, 50000, 100000, 200000, 500000, 1000000];
var ticks = [];
- const self = this;
+ const that = this;
function addTick(position, segment, distanceValue) {
if (bounds) {
// create markers only in visible part of map
- const normalizedBounds = self._map.wrapLatLngBounds(bounds);
+ const normalizedBounds = that._map.wrapLatLngBounds(bounds);
const normalizedPosition = position.wrap();
// account for worldCopyJump
const positionMinus360 = L.latLng(normalizedPosition.lat, normalizedPosition.lng - 360);