#204 Reset button group when closing w/out saving

This commit is contained in:
Mike Koch 2015-05-23 20:34:45 -04:00
parent 1efb9b69b5
commit 73264a6af0
2 changed files with 7 additions and 1 deletions

View File

@ -913,7 +913,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<input type="submit" class="btn btn-success"
value="<?php echo $hesklang['save_location']; ?>">
<button class="btn btn-default" data-dismiss="modal"
onclick="resetLatLon(<?php echo $ticket['latitude']; ?>, <?php echo $ticket['longitude']; ?>)">
onclick="closeAndReset(<?php echo $ticket['latitude']; ?>, <?php echo $ticket['longitude']; ?>)">
<?php echo $hesklang['close_modal_without_saving']; ?>
</button>
</div>

View File

@ -143,6 +143,12 @@ function resetLatLon(lat, lon) {
marker.setLatLng(L.latLng(lat, lon));
}
function closeAndReset(lat, lon) {
$('#save-group').hide();
$('#close-button').show();
resetLatLon(lat, lon);
}
function initializeMapForStaff(latitude, longitude, usersLocationText) {
map = L.map('map').setView([latitude, longitude], 15);
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {