Merge pull request #440 from metamaps/feature/fix.fork.filter.bug
fix filter bug
This commit is contained in:
commit
3b89a2a13f
1 changed files with 28 additions and 20 deletions
|
@ -3300,26 +3300,34 @@ Metamaps.Filter = {
|
||||||
// the first option enables us to accept
|
// the first option enables us to accept
|
||||||
// ['Topics', 'Synapses'] as 'collection'
|
// ['Topics', 'Synapses'] as 'collection'
|
||||||
if (typeof collection === "object") {
|
if (typeof collection === "object") {
|
||||||
Metamaps[collection[0]].each(function(model) {
|
Metamaps[collection[0]].each(function(model) {
|
||||||
var prop = model.get(propertyToCheck) ? model.get(propertyToCheck).toString() : false;
|
var prop = model.get(propertyToCheck);
|
||||||
if (prop && newList.indexOf(prop) === -1) {
|
if (prop !== null) {
|
||||||
newList.push(prop);
|
prop = prop.toString();
|
||||||
}
|
if (newList.indexOf(prop) === -1) {
|
||||||
});
|
newList.push(prop);
|
||||||
Metamaps[collection[1]].each(function(model) {
|
}
|
||||||
var prop = model.get(propertyToCheck) ? model.get(propertyToCheck).toString() : false;
|
}
|
||||||
if (prop && newList.indexOf(prop) === -1) {
|
});
|
||||||
newList.push(prop);
|
Metamaps[collection[1]].each(function(model) {
|
||||||
}
|
var prop = model.get(propertyToCheck);
|
||||||
});
|
if (prop !== null) {
|
||||||
}
|
prop = prop.toString();
|
||||||
else if (typeof collection === "string") {
|
if (newList.indexOf(prop) === -1) {
|
||||||
Metamaps[collection].each(function(model) {
|
newList.push(prop);
|
||||||
var prop = model.get(propertyToCheck) ? model.get(propertyToCheck).toString() : false;
|
}
|
||||||
if (prop && newList.indexOf(prop) === -1) {
|
}
|
||||||
newList.push(prop);
|
});
|
||||||
}
|
} else if (typeof collection === "string") {
|
||||||
});
|
Metamaps[collection].each(function(model) {
|
||||||
|
var prop = model.get(propertyToCheck);
|
||||||
|
if (prop !== null) {
|
||||||
|
prop = prop.toString();
|
||||||
|
if (newList.indexOf(prop) === -1) {
|
||||||
|
newList.push(prop);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
removed = _.difference(self.filters[filtersToUse], newList);
|
removed = _.difference(self.filters[filtersToUse], newList);
|
||||||
|
|
Loading…
Reference in a new issue