Merge branch 'bugfix/part-creation-matrice-dropdown-fix'
This commit is contained in:
commit
1c2b4ab7a6
@ -6,7 +6,7 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="row main-row">
|
||||
<div class="col-md-9">
|
||||
<!-- Prima riga: Elenco Parti, Rinumera, Voce -->
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;">
|
||||
@ -14,6 +14,10 @@
|
||||
<div style="display: flex; align-items: center;">
|
||||
<button type="button" class="btn btn-info btn-sm" id="renumberPartsBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">Rinumera Parti</button>
|
||||
<button type="button" class="btn btn-secondary btn-sm ms-2" id="toggleVoiceBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;"><i class="fas fa-microphone"></i> Voce</button>
|
||||
<button type="button" class="btn btn-primary btn-sm ms-2" id="showHideImageBtn" style="padding: 0.1rem 0.5rem; font-size: 0.8rem;">
|
||||
<i class="fas fa-eye-slash" style="font-size: 0.8rem;"></i>
|
||||
<i class="fas fa-image ms-1" style="font-size: 0.8rem;"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Seconda riga: +, M, MacroMatrice, Matrice globale, Propaga -->
|
||||
|
||||
@ -1339,6 +1339,7 @@ $(document).ready(function () {
|
||||
partId,
|
||||
currentValue,
|
||||
selectedMacro,
|
||||
true
|
||||
);
|
||||
});
|
||||
});
|
||||
@ -1415,6 +1416,7 @@ $(document).ready(function () {
|
||||
partId,
|
||||
idmatrice,
|
||||
selectedMacro = null,
|
||||
fromFilter = false
|
||||
) {
|
||||
if (typeof $.fn.select2 === "undefined") {
|
||||
$select.replaceWith(
|
||||
@ -1484,16 +1486,24 @@ $(document).ready(function () {
|
||||
true,
|
||||
true,
|
||||
);
|
||||
$select.append(option).trigger("change");
|
||||
|
||||
if (!fromFilter) $select.append(option).trigger("change");
|
||||
else $select.append(option);
|
||||
|
||||
partMatrice[partNumber] = matrice.IdMatrice;
|
||||
} else {
|
||||
// Aggiusta valore non valido
|
||||
$select.val(null).trigger("change");
|
||||
if (!fromFilter) $select.val(null).trigger("change");
|
||||
|
||||
partMatrice[partNumber] = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$select.val(null).trigger("change", [{ skipHandler: true }]);
|
||||
}
|
||||
|
||||
$select.on("change", function (event, data) {
|
||||
if (data && data?.skipHandler) return;
|
||||
|
||||
$select.on("change", function () {
|
||||
const idmatrice = $(this).val();
|
||||
const $row = $(this).closest("tr");
|
||||
const partId = $row.data("part-id");
|
||||
@ -2000,3 +2010,19 @@ $(document).on("click", ".save-common-note-btn", function () {
|
||||
markUnsaved();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", "#showHideImageBtn", function () {
|
||||
let mainRow = $(this).closest(".main-row");
|
||||
let photoContainer = mainRow.find(".col-md-3");
|
||||
let tableContainer = mainRow.find("#partsTable").closest("div[class*='col-md']");
|
||||
|
||||
if (photoContainer.hasClass("d-none")) {
|
||||
photoContainer.removeClass("d-none");
|
||||
tableContainer.removeClass("col-md-12").addClass("col-md-9");
|
||||
$(this).html("<i class='fas fa-eye-slash' style='font-size: 0.8rem;'></i><i class='fas fa-image ms-1' style='font-size: 0.8rem;'></i>");
|
||||
} else {
|
||||
photoContainer.addClass("d-none");
|
||||
tableContainer.removeClass("col-md-9").addClass("col-md-12");
|
||||
$(this).html("<i class='fas fa-eye' style='font-size: 0.8rem;'></i><i class='fas fa-image ms-1' style='font-size: 0.8rem;'></i>");
|
||||
}
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user