new function added

This commit is contained in:
cesare 2022-04-22 16:49:32 +02:00
parent 1b54b0d8f4
commit 07e58b3f06
2 changed files with 49 additions and 11 deletions

View File

@ -221,13 +221,18 @@
<div class="flex items-center justify-center pa1 bg-lightest-blue navy"
style="display: none;" id="filtrogrammaticale">
<div class="flex flex-column">
<nav class="pa1 pa1-ns">
<a class="link dim gray f6 f2-ns dib mr0 delete-written-filter" href="#"
title="Remove"><img src="./images/chiudi1.png"
style="width: 22px; height: 20px;"></a>
<select id="andor" style="display: none;"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray andorconditions"
name="condizionelogica" onchange="" title="Condizione logica">
<option value="all">AND</option>
<option value="all">OR</option>
</select>
</nav>
<!-- <span class="lh-title ml3">Clausola grammaticale</span>-->
<div class="pa1 pa1-ns listacondizioni">
<h4 class="f6 fw6">Clausola grammaticale</h4>
<dl class="f6 lh-title mv2">
@ -244,9 +249,20 @@
</dl>
</div>
</div>
</div>
<!-- DIV CONDIZIONE LOGICA -->
<div class="outline w-100 pa1 mr1" id="andor" style="display: none;">
<select id="andorconditions"
class="w-100 db h2 f6 bg-near-white ba b--sliver gray catgram"
name="condizionelogica" onchange="" title="Condizione logica">
<option value="all">AND</option>
<option value="all">OR</option>
</select>
</div>
<!-- DIV DETTAGLIFILTRI -->
<div style="display: none;" id='divdettaglifiltri'>

View File

@ -152,6 +152,7 @@ $(document).ready(function() {
element.attr('id', 'cg-' + size);
element.find('.remove-filter').attr('target','cg-'+size);
element.find('.set-filter').attr('targetfilter','cg-'+size);
element.appendTo('#condizioni');
element.find('.sn').html(size);
grammarconditions = grammarconditions + 1
@ -169,6 +170,7 @@ $(document).ready(function() {
element.attr('id', 'ts-' + size);
element.find('.remove-filter').attr('target','ts-'+size);
element.find('.set-filter').attr('targetfilter','ts-'+size);
element.appendTo('#condizioni');
element.find('.sn').html(size);
if (size == 1)
@ -386,7 +388,8 @@ $(document).ready(function() {
return false;
}
});
jQuery(document).delegate('a.remove-filter', 'click', function(e) {
jQuery(document).delegate('a.remove-filter', 'click', function (e) {
e.preventDefault();
var didConfirm = confirm("Sei sicuro di voler eliminare la clausola?");
if (didConfirm == true) {
@ -407,15 +410,34 @@ $(document).ready(function() {
jQuery(document).delegate('a.set-filter', 'click', function(e) {
e.preventDefault();
var content = jQuery('#filtrogrammaticale'),
var didConfirm = confirm("Sei sicuro di voler definire il filtro '"+categoriaGrammaticaleFiltro+"'?");
if (didConfirm == true) {
var content = jQuery('#filtrogrammaticale'),
size = jQuery('#filtri >div').length + 1,
element = null,
element = content.clone();
alert(categoriaGrammaticaleFiltro + " "+size)
element.attr('id', 'filtro-' + size);
element.find('.delete-written-filter').attr('target','filtro-'+size);
element.attr('style','display.block');
element.appendTo('#filtri');
element.attr('id', 'filtro-' + size);
element.find('.delete-written-filter').attr('target','filtro-'+size);
element.attr('style','display.block');
element.appendTo('#filtri');
if (size>1){
element.find('.andorconditions').attr('style', 'display.block');
}
//$('a.remove-filter').trigger('click');
var targetDiv = jQuery(this).attr('targetfilter');
rmel=jQuery('#'+targetDiv)
rmeldetail=jQuery('#'+'dettaglio_' + targetDiv)
jQuery(rmel).remove();
jQuery(rmeldetail).remove();
return true;
} else {
return false;
}
})