commit d5d4f8a27b35d063a5d320c384e30d1069e93a72
parent 1ac93524b39031dd95a08257ab2c5fe9ce67e3be
Author: Sergey Orlov <wladimirych@gmail.com>
Date: Tue, 30 Jun 2020 19:10:14 +0200
track-list: hide join selection cursor when hiding the track
Diffstat:
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/lib/leaflet.control.track-list/track-list.js b/src/lib/leaflet.control.track-list/track-list.js
@@ -645,9 +645,7 @@ L.Control.TrackList = L.Control.extend({
stopEditLine: function() {
if (this._editedLine) {
- this.hideLineCursor();
this._editedLine.stopEdit();
- this._editedLine = null;
}
},
@@ -874,9 +872,7 @@ L.Control.TrackList = L.Control.extend({
this.map.on('click', this.hideLineCursor, this);
L.DomEvent.on(document, 'keyup', this.onKeyUpForLineCursor, this);
L.DomUtil.addClass(this.map.getContainer(), 'tracklist-line-cursor-shown');
- setTimeout(() => {
- this._editedLine.preventStopEdit = true;
- }, 0);
+ this._editedLine.preventStopEdit = true;
},
hideLineCursor: function() {
@@ -888,9 +884,7 @@ L.Control.TrackList = L.Control.extend({
this.map.removeLayer(this._lineCursor);
this._lineCursor = null;
this.fire('linecursorhide');
- setTimeout(() => {
- this._editedLine.preventStopEdit = false;
- }, 0);
+ this._editedLine.preventStopEdit = false;
}
},
@@ -963,6 +957,8 @@ L.Control.TrackList = L.Control.extend({
onTrackEditEnd: function(track) {
track.isEdited(false);
+ this.hideLineCursor();
+ this._editedLine = null;
},
onTrackRowMouseEnter: function(track) {