refs #16 cancel deletion or edition when loading or clearing the map, this avoids data losses

merge-requests/1/head
Julien Veyssier 2017-05-24 14:37:34 +02:00
parent 2515fe0553
commit 814c681e60
1 changed files with 8 additions and 0 deletions

View File

@ -1430,9 +1430,17 @@
}); });
$('button#clearButton').click(function(e) { $('button#clearButton').click(function(e) {
var cancelButton = $('.leaflet-draw .leaflet-draw-section:nth-child(2) li:nth-child(2) a');
if (cancelButton.is(':visible')) {
cancelButton[0].click();
}
clear(); clear();
}); });
$('button#loadButton').click(function(e) { $('button#loadButton').click(function(e) {
var cancelButton = $('.leaflet-draw .leaflet-draw-section:nth-child(2) li:nth-child(2) a');
if (cancelButton.is(':visible')) {
cancelButton[0].click();
}
if (gpxedit.currentAjax !== null) { if (gpxedit.currentAjax !== null) {
gpxedit.currentAjax.abort(); gpxedit.currentAjax.abort();
hideLoadingAnimation(); hideLoadingAnimation();