Let user delete route and/or nogo areas

Fix issue #217.
This commit is contained in:
Phyks (Lucas Verney) 2019-08-04 16:10:23 +02:00
parent d45572b76d
commit 0001d487a4

View file

@ -94,18 +94,25 @@
function() { function() {
bootbox.prompt({ bootbox.prompt({
size: 'small', size: 'small',
title: i18next.t('map.delete-route'), title: i18next.t('map.delete-route-nogos'),
inputType: 'checkbox', inputType: 'checkbox',
inputOptions: [ inputOptions: [
{
text: i18next.t('map.delete-route'),
value: 'route'
},
{ {
text: i18next.t('map.delete-nogo-areas'), text: i18next.t('map.delete-nogo-areas'),
value: 'nogo' value: 'nogo'
} }
], ],
value: ['route'],
callback: function(result) { callback: function(result) {
if (result !== null) { if (result !== null) {
routing.clear(); if (result.indexOf('route') !== -1) {
if (result.length > 0 && result[0] === 'nogo') { routing.clear();
}
if (result.indexOf('nogo') !== -1) {
nogos.clear(); nogos.clear();
} }
onUpdate(); onUpdate();
@ -114,7 +121,7 @@
} }
}); });
}, },
i18next.t('map.clear-route') i18next.t('map.delete-route-nogos')
); );
function updateRoute(evt) { function updateRoute(evt) {