diff --git a/js/utils.js b/js/utils.js index 4643662..4692351 100644 --- a/js/utils.js +++ b/js/utils.js @@ -423,17 +423,22 @@ function parseJsonClause(op, tokens, nowhere) { //alert(op) var idp = -1 if (nowhere[0].type == 'filter' && nowhere[0].expression.args[0].value == 'Rappresentazione') { - nowhere.splice(0, 1) + //nowhere.splice(0, 1) + nowhere.splice(0, 2) } if (op.trim() == 'OR') { - //nowhere.unshift(JSON.parse(unionop)['union']); - nowhere.splice(1, 0, JSON.parse(unionop)['union']) - idp = 1 + + //nowhere.splice(1, 0, JSON.parse(unionop)['union']) + nowhere.splice(0, 0, JSON.parse(unionop)['union']) + //idp = 1 + idp = 0 } if (op.trim() == 'AND') { - //nowhere.push(JSON.parse(unionop)['group']); - nowhere.splice(1, 0, JSON.parse(unionop)['group']) - idp = 1 + + //nowhere.splice(1, 0, JSON.parse(unionop)['group']) + nowhere.splice(0, 0, JSON.parse(unionop)['group']) + //idp = 1 + idp = 0 } for (var mtoken in tokens) {