From 993c271fa84f29f3c2659adef8966afa2ca9e719 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Fri, 1 Mar 2024 04:31:13 -0700 Subject: [PATCH] deprecated pinned notes --- Views/Home/_GarageDisplay.cshtml | 2 +- Views/Home/_VehicleExtraFields.cshtml | 10 ++++++++++ wwwroot/js/garage.js | 23 ++--------------------- 3 files changed, 13 insertions(+), 22 deletions(-) create mode 100644 Views/Home/_VehicleExtraFields.cshtml diff --git a/Views/Home/_GarageDisplay.cshtml b/Views/Home/_GarageDisplay.cshtml index a4832a6..84b2528 100644 --- a/Views/Home/_GarageDisplay.cshtml +++ b/Views/Home/_GarageDisplay.cshtml @@ -28,7 +28,7 @@
@foreach (Vehicle vehicle in Model) { -
+
@if (!string.IsNullOrWhiteSpace(vehicle.SoldDate)) diff --git a/Views/Home/_VehicleExtraFields.cshtml b/Views/Home/_VehicleExtraFields.cshtml new file mode 100644 index 0000000..d27fe87 --- /dev/null +++ b/Views/Home/_VehicleExtraFields.cshtml @@ -0,0 +1,10 @@ +@model List +@if (Model.Any()) +{ +
    + @foreach (ExtraField field in Model) + { +
  • @field.Name : @field.Value
  • + } +
+} \ No newline at end of file diff --git a/wwwroot/js/garage.js b/wwwroot/js/garage.js index ad6036e..ef2158a 100644 --- a/wwwroot/js/garage.js +++ b/wwwroot/js/garage.js @@ -173,27 +173,8 @@ function performLogOut() { } function loadPinnedNotes(vehicleId) { var hoveredGrid = $(`#gridVehicle_${vehicleId}`); - if (hoveredGrid.attr("data-bs-title") == undefined) { - $.get(`/Vehicle/GetPinnedNotesByVehicleId?vehicleId=${vehicleId}`, function (data) { - if (data.length > 0) { - //converted pinned notes to html. - var htmlString = "
    "; - data.forEach(x => { - htmlString += `
  • ${x.description} : ${x.noteText}
  • `; - }); - htmlString += "
"; - hoveredGrid.attr("data-bs-title", htmlString); - new bootstrap.Tooltip(hoveredGrid); - hoveredGrid.tooltip("show"); - } else { - //disable the tooltip - hoveredGrid.attr("data-bs-title", ""); - } - }); - } else { - if (hoveredGrid.attr("data-bs-title") != '') { - hoveredGrid.tooltip("show"); - } + if (hoveredGrid.attr("data-bs-title") != '') { + hoveredGrid.tooltip("show"); } } function hidePinnedNotes(vehicleId) {