This commit is contained in:
nicola 2023-01-10 10:43:15 +01:00
commit 3f89ee28ca
2 changed files with 18 additions and 8 deletions

View File

@ -1073,12 +1073,11 @@
<div id="cla-Advanced" style="display: d-flex">
<div class=" p-1 border bg-light well" id="cla-list">
<div class="row mx-0 justify-content-between">
<div class="col-12 px-0 pb-1 small font-weight-bold text-muted">AND</div>
<div id="cla-list-row" class="row mx-0 justify-content-between">
<div class="col-12 p-0">
<ul id="sortable0" class="condLIand list-group ui-sortable">
<li id="li-cla0"
class="list-group-item align-items-center mb-1 ui-state-default ui-state-disabled border text-muted bg-white ui-state-disabled-opacity-06 small">Nessuna
class="list-group-item align-items-center my-1 ui-state-default ui-state-disabled border text-muted bg-white ui-state-disabled-opacity-06 small">Nessuna
clausola aggiunta.</li>
</ul>
</div>

View File

@ -85,6 +85,7 @@ $(document).ready(function() {
};
})
// Evento: click sulsullo switch di ricerca avanzata
$('#searchToggle').on('change', function() {
if ($(this).prop('checked')) {
queryJson.QueryAvanzata = "1";
@ -150,6 +151,7 @@ $(document).ready(function() {
$('#sortable0').on('click', '.removeCond', function() {
$(this).closest('ul').parent().remove();
condListLen--;
refreshClaList();
refreshSortables();
refreshConnectWith();
if (claListLen == 0 && condListLen == 0) {
@ -190,6 +192,7 @@ $(document).ready(function() {
opacity: 0.6,
cursor: 'move',
update: function() {
refreshClaList();
refreshSortables();
}
});
@ -494,7 +497,8 @@ $(document).ready(function() {
// Variabili testuali per compattezza
var iconReset = '<div class="text-right text-primary radioReset"><ion-icon name="refresh-circle"></ion-icon></div>';
var iconCloseCond = '<div class="p-0 mr-3 mt-1 text-right text-primary"><span class="iconClClass removeCond"><ion-icon name="close-circle"></ion-icon></span></div>';
var emptyClaList = '<li id="li-cla0" class="list-group-item align-items-center mb-1 ui-state-default ui-state-disabled border text-muted bg-white ui-state-disabled-opacity-06 small">Nessuna clausola aggiunta.</li>';
var emptyClaList = '<li id="li-cla0" class="list-group-item align-items-center my-1 ui-state-default ui-state-disabled border text-muted bg-white ui-state-disabled-opacity-06 small">Nessuna clausola aggiunta.</li>';
var defaultCond = '<div id="cla-defaultCond" class="col-12 px-0 pb-1 small font-weight-bold text-muted">AND</div>';
var condLIplaceholderText1 = 'Trascina qui almeno 1 clausola o condizione';
var condLIplaceholderText2 = 'Trascina qui almeno 2 clausole o condizioni';
@ -831,6 +835,13 @@ $(document).ready(function() {
}
tabID = 0;
};
if ($('#sortable0').children("li").length <= 1) {
$("#cla-defaultCond").remove();
} else {
if ($('#cla-defaultCond').length == 0) {
$("#cla-list-row").prepend($(defaultCond));
}
};
}
// Funzione di creazione del LI nella lista delle clausole nel tab principale, aggiunta della clausola nel JSON