updated cached view to only show when there are unsaved changes present.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-04-05 07:10:09 -06:00
parent 44e3d19844
commit 2a2cb3bd0c
19 changed files with 36 additions and 63 deletions

View File

@@ -15,7 +15,7 @@ function showEditOdometerRecordModal(odometerRecordId, nocache) {
if (existingContent.trim() != '') {
//check if id is same.
var existingId = getOdometerRecordModelData().id;
if (existingId == odometerRecordId) {
if (existingId == odometerRecordId && $('[data-changed=true]').length > 0) {
$('#odometerRecordModal').modal('show');
$('.cached-banner').show();
return;
@@ -29,6 +29,7 @@ function showEditOdometerRecordModal(odometerRecordId, nocache) {
initDatePicker($('#odometerRecordDate'));
initTagSelector($("#odometerRecordTag"));
$('#odometerRecordModal').modal('show');
bindModalInputChanges('odometerRecordModal');
$('#odometerRecordModal').off('shown.bs.modal').on('shown.bs.modal', function () {
if (getGlobalConfig().useMarkDown) {
toggleMarkDownOverlay("odometerRecordNotes");