diff --git a/o2web/source/x_component_process_Xform/Opinion.js b/o2web/source/x_component_process_Xform/Opinion.js index 5a37528f0a65a769b07d8ebc6a0572b20b30c6df..0bfdd28a7ef924752b46ddc11ec9cb3ce67a7ce3 100644 --- a/o2web/source/x_component_process_Xform/Opinion.js +++ b/o2web/source/x_component_process_Xform/Opinion.js @@ -364,21 +364,23 @@ MWF.xApplication.process.Xform.Opinion = MWF.APPOpinion = new Class({ this.searcheOpinionId = ""; } }, - searchOpinions: function(t){ + searchOpinions: function(t) { var value = this.input.get("value"); var arr = value.split(/[\n\r]/g); lines = arr.length; - value = arr[arr.length-1]; + value = arr[arr.length - 1]; var offsetValue = value; //var offsetValue = value.substr(0, value.length-t.length); - var ops = this.userOpinions.filter(function(v, i){ - return v.contains(t) && (v!=t); - }.bind(this)); - if (ops.length){ - this.showSelectOpinionNode(ops, offsetValue, lines); - }else{ - this.hideSelectOpinionNode(ops); + if (this.userOpinions){ + var ops = this.userOpinions.filter(function (v, i) { + return v.contains(t) && (v != t); + }.bind(this)); + if (ops.length) { + this.showSelectOpinionNode(ops, offsetValue, lines); + } else { + this.hideSelectOpinionNode(ops); + } } }, hideSelectOpinionNode: function(){