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:
parent
f6cf79f3ac
commit
c6fe94442e
1 changed files with 7 additions and 6 deletions
|
@ -173,7 +173,9 @@ var customForm = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getAcFilter: function() {
|
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({
|
$.ajax({
|
||||||
url: customForm.sparqlQueryUrl,
|
url: customForm.sparqlQueryUrl,
|
||||||
data: {
|
data: {
|
||||||
|
@ -189,12 +191,11 @@ var customForm = {
|
||||||
},
|
},
|
||||||
|
|
||||||
setAcFilter: function(data) {
|
setAcFilter: function(data) {
|
||||||
var filter = [],
|
var key = data.head.vars[0];
|
||||||
key = data.head.vars[0];
|
|
||||||
$.each(data.results.bindings, function() {
|
$.each(data.results.bindings, function() {
|
||||||
filter.push(this[key].value);
|
this.acFilter.push(this[key].value);
|
||||||
});
|
});
|
||||||
this.acFilter = filter;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
filterAcResults: function(results) {
|
filterAcResults: function(results) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue