NIHVIVO-725 Define acFilter before the sparql query, so in case the latter fails we don't get an error later when referencing the filter.

This commit is contained in:
rjy7 2010-07-13 14:11:37 +00:00
parent f6cf79f3ac
commit c6fe94442e

View file

@ -173,7 +173,9 @@ var customForm = {
},
getAcFilter: function() {
// Define this.acFilter here, so in case the sparql query fails
// we don't get an error when referencing it later.
this.acFilter = [];
$.ajax({
url: customForm.sparqlQueryUrl,
data: {
@ -189,12 +191,11 @@ var customForm = {
},
setAcFilter: function(data) {
var filter = [],
key = data.head.vars[0];
var key = data.head.vars[0];
$.each(data.results.bindings, function() {
filter.push(this[key].value);
});
this.acFilter = filter;
this.acFilter.push(this[key].value);
});
},
filterAcResults: function(results) {