Map: edit INIT button to clear caches & add drawPoint function when saving inputs
This commit is contained in:
parent
d747fa2519
commit
4047bc4d18
|
|
@ -308,7 +308,7 @@
|
|||
<button class="btn-blue-map btn-current" type="button">CURRENT</button>
|
||||
<button class="btn-primary-map btn-routeplanner" type="button" data-toggle="modal" data-target="#routePlannerModal">ROUTE PLANNER</button>
|
||||
<button class="btn-orange-map btn-route-print hidden" type="button">PRINT</button>
|
||||
<button class="btn-red-map btn-init" type="button" onClick="javascript:location.reload();">INIT</button>
|
||||
<button class="btn-red-map btn-init" type="button" onClick="forceRefresh()">INIT</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
|
@ -1238,7 +1238,12 @@ function popup(){
|
|||
|
||||
}
|
||||
|
||||
api('saveInput', data, rstSaveInput);
|
||||
// api('saveInput', data, rstSaveInput);
|
||||
|
||||
api('saveInput', data, function(rst){
|
||||
rstSaveInput(rst);
|
||||
drawPoint(); // 저장시 깃발 색깔 변경
|
||||
});
|
||||
|
||||
//let pickupdata = {
|
||||
// "route_date" : jQuery("#orderdate").val(),
|
||||
|
|
@ -2253,4 +2258,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
async function forceRefresh() {
|
||||
if ('caches' in window) {
|
||||
const keys = await caches.keys();
|
||||
await Promise.all(keys.map(key => caches.delete(key)));
|
||||
}
|
||||
window.location.reload();
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in New Issue