Skip to content

Commit

Permalink
fix so calculated nutrients show when editing
Browse files Browse the repository at this point in the history
  • Loading branch information
lunamoonmoon committed Jan 3, 2025
1 parent e8124c4 commit a7f04e3
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,17 +550,17 @@ $(document).ready(function () {
updateUnits();
function editCalculate() {
//to alculate Nutrients when editing
//to calculate Nutrients when editing
var modelTitle = $('#myModalLabel').text().toLowerCase();
if (modelTitle.includes("edit")) {
setTimeout(function () {
$('#calc_button').click();
}, 500); // 500ms delay to ensure the modal is fully rendered
}, 1000);
}
}
$('#myModal').on('show.bs.modal', function () {
editCalculate(); // Call the function when the modal opens
editCalculate();
});
});
Expand Down

0 comments on commit a7f04e3

Please sign in to comment.