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 id="cla-Advanced" style="display: d-flex">
<div class=" p-1 border bg-light well" id="cla-list"> <div class=" p-1 border bg-light well" id="cla-list">
<div class="row mx-0 justify-content-between"> <div id="cla-list-row" class="row mx-0 justify-content-between">
<div class="col-12 px-0 pb-1 small font-weight-bold text-muted">AND</div>
<div class="col-12 p-0"> <div class="col-12 p-0">
<ul id="sortable0" class="condLIand list-group ui-sortable"> <ul id="sortable0" class="condLIand list-group ui-sortable">
<li id="li-cla0" <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> clausola aggiunta.</li>
</ul> </ul>
</div> </div>

View File

@ -85,6 +85,7 @@ $(document).ready(function() {
}; };
}) })
// Evento: click sulsullo switch di ricerca avanzata
$('#searchToggle').on('change', function() { $('#searchToggle').on('change', function() {
if ($(this).prop('checked')) { if ($(this).prop('checked')) {
queryJson.QueryAvanzata = "1"; queryJson.QueryAvanzata = "1";
@ -150,6 +151,7 @@ $(document).ready(function() {
$('#sortable0').on('click', '.removeCond', function() { $('#sortable0').on('click', '.removeCond', function() {
$(this).closest('ul').parent().remove(); $(this).closest('ul').parent().remove();
condListLen--; condListLen--;
refreshClaList();
refreshSortables(); refreshSortables();
refreshConnectWith(); refreshConnectWith();
if (claListLen == 0 && condListLen == 0) { if (claListLen == 0 && condListLen == 0) {
@ -190,6 +192,7 @@ $(document).ready(function() {
opacity: 0.6, opacity: 0.6,
cursor: 'move', cursor: 'move',
update: function() { update: function() {
refreshClaList();
refreshSortables(); refreshSortables();
} }
}); });
@ -494,7 +497,8 @@ $(document).ready(function() {
// Variabili testuali per compattezza // Variabili testuali per compattezza
var iconReset = '<div class="text-right text-primary radioReset"><ion-icon name="refresh-circle"></ion-icon></div>'; 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 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 condLIplaceholderText1 = 'Trascina qui almeno 1 clausola o condizione';
var condLIplaceholderText2 = 'Trascina qui almeno 2 clausole o condizioni'; var condLIplaceholderText2 = 'Trascina qui almeno 2 clausole o condizioni';
@ -831,6 +835,13 @@ $(document).ready(function() {
} }
tabID = 0; 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 // Funzione di creazione del LI nella lista delle clausole nel tab principale, aggiunta della clausola nel JSON