NIHVIVO-725 Fixing error in previous commit: 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:
parent
1a14ffba90
commit
cddda3087a
1 changed files with 5 additions and 2 deletions
|
@ -194,15 +194,18 @@ var customForm = {
|
||||||
var key = data.head.vars[0];
|
var key = data.head.vars[0];
|
||||||
|
|
||||||
$.each(data.results.bindings, function() {
|
$.each(data.results.bindings, function() {
|
||||||
this.acFilter.push(this[key].value);
|
customForm.acFilter.push(this[key].value);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
filterAcResults: function(results) {
|
filterAcResults: function(results) {
|
||||||
var filteredResults = [];
|
var filteredResults;
|
||||||
|
|
||||||
if (!this.acFilter.length) {
|
if (!this.acFilter.length) {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filteredResults = [];
|
||||||
$.each(results, function() {
|
$.each(results, function() {
|
||||||
if ($.inArray(this.uri, customForm.acFilter) == -1) {
|
if ($.inArray(this.uri, customForm.acFilter) == -1) {
|
||||||
// console.log("adding " + this.label + " to filtered results");
|
// console.log("adding " + this.label + " to filtered results");
|
||||||
|
|
Loading…
Add table
Reference in a new issue