diff --git a/index_work.html b/index_work.html
index 336a3bf..a067026 100644
--- a/index_work.html
+++ b/index_work.html
@@ -221,13 +221,18 @@
+
-
-
Clausola grammaticale
@@ -244,9 +249,20 @@
-
-
+
+
+
+
+
+
+
+
diff --git a/js/guimanager.js b/js/guimanager.js
index 7b23996..8e1885d 100644
--- a/js/guimanager.js
+++ b/js/guimanager.js
@@ -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;
+ }
+
})