Compare commits
1 Commits
develop
...
wip/MAPG-1
Author | SHA1 | Date | |
---|---|---|---|
7c96ba24d6 |
@ -13,6 +13,7 @@
|
||||
added: {},
|
||||
edited: {},
|
||||
deleted: {},
|
||||
saved: true,
|
||||
|
||||
editMetadata: function () {
|
||||
var form = document.getElementById('metadataForm');
|
||||
@ -24,6 +25,7 @@
|
||||
|
||||
MapGuesser.hideModal();
|
||||
|
||||
MapEditor.saved = false;
|
||||
document.getElementById('saveButton').disabled = false;
|
||||
},
|
||||
|
||||
@ -210,6 +212,7 @@
|
||||
|
||||
MapEditor.selectedMarker.setLatLng({ lat: places[placeId].lat, lng: places[placeId].lng });
|
||||
|
||||
MapEditor.saved = false;
|
||||
document.getElementById('saveButton').disabled = false;
|
||||
},
|
||||
|
||||
@ -243,6 +246,7 @@
|
||||
document.getElementById('added').innerHTML = String(Object.keys(MapEditor.added).length);
|
||||
document.getElementById('edited').innerHTML = String(Object.keys(MapEditor.edited).length);
|
||||
|
||||
MapEditor.saved = false;
|
||||
document.getElementById('saveButton').disabled = false;
|
||||
},
|
||||
|
||||
@ -300,6 +304,7 @@
|
||||
document.getElementById('edited').innerHTML = '0';
|
||||
document.getElementById('deleted').innerHTML = '0';
|
||||
|
||||
MapEditor.saved = true;
|
||||
document.getElementById('saveButton').disabled = true;
|
||||
}, data);
|
||||
},
|
||||
@ -440,4 +445,13 @@
|
||||
document.getElementById('deleteButton').onclick = function () {
|
||||
MapEditor.deletePlace();
|
||||
};
|
||||
|
||||
window.addEventListener('beforeunload', function (e) {
|
||||
if (MapEditor.saved) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
e.returnValue = '';
|
||||
});
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user