Moved template modal outside of add modal.

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-04-05 19:36:26 -06:00
parent 4c30939339
commit c582f5f5c7
3 changed files with 4 additions and 9 deletions

View File

@@ -98,22 +98,19 @@ function showPlanRecordTemplatesModal() {
$.get(`/Vehicle/GetPlanRecordTemplatesForVehicleId?vehicleId=${vehicleId}`, function (data) {
if (data) {
$("#planRecordTemplateModalContent").html(data);
hideAddPlanRecordModal();
$('#planRecordTemplateModal').modal('show');
}
});
}
function hidePlanRecordTemplatesModal() {
$('#planRecordTemplateModal').modal('hide');
$('#planRecordModal').modal('show');
}
function usePlannerRecordTemplate(planRecordTemplateId) {
$.post(`/Vehicle/ConvertPlanRecordTemplateToPlanRecord?planRecordTemplateId=${planRecordTemplateId}`, function (data) {
if (data.success) {
var vehicleId = GetVehicleId().vehicleId;
successToast(data.message);
$('#planRecordTemplateModal').modal('hide');
hideAddPlanRecordModal();
hidePlanRecordTemplatesModal();
saveScrollPosition();
getVehiclePlanRecords(vehicleId);
} else {