commit 0a58c993692e3ff838ef797c467d41131fd583f3
parent 2300fa6ffaf86205fdf69975f0cbf1119c553f88
Author: Sergej Orlov <wladimirych@gmail.com>
Date: Sat, 25 Jan 2020 22:02:32 +0100
fix lint errors (no-negated-condition)
Diffstat:
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/lib/leaflet.control.azimuth/index.js b/src/lib/leaflet.control.azimuth/index.js
@@ -185,10 +185,10 @@ L.Control.Azimuth = L.Control.extend({
const azimuth = calcAzimuth(points.start, points.end);
this.trueAzimuth(roundAzimuth(azimuth));
const declination = getDeclination(points.start.lat, points.start.lng);
- if (declination !== null) {
- this.magneticAzimuth(roundAzimuth(azimuth - declination));
- } else {
+ if (declination === null) {
this.magneticAzimuth(null);
+ } else {
+ this.magneticAzimuth(roundAzimuth(azimuth - declination));
}
this.distance(points.start.distanceTo(points.end));
diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js
@@ -203,10 +203,10 @@ L.Control.TrackList = L.Control.extend({
addNewTrack: function(name) {
if (!name) {
name = this.url().slice(0, 50);
- if (!name.length) {
- name = 'New track';
- } else {
+ if (name.length) {
this.url('');
+ } else {
+ name = 'New track';
}
}
this.stopPlacingPoint();
diff --git a/src/lib/leaflet.polyline-edit/index.js b/src/lib/leaflet.polyline-edit/index.js
@@ -371,7 +371,7 @@ L.Polyline.EditMixin = {
const startIndex = this._drawingDirection === -1 ? 1 : 0;
const endIndex = this._drawingDirection === 1 ? nodesCount - 2 : nodesCount - 1;
const startIcon = this._latlngs[startIndex]._nodeMarker._icon;
- L.DomUtil[this._drawingDirection !== -1 ? 'addClass' : 'removeClass'](
+ L.DomUtil[this._drawingDirection === -1 ? 'removeClass' : 'addClass'](
startIcon, 'line-editor-node-marker-start'
);
if (endIndex >= 0) {