Skip to content

Commit

Permalink
Fixed 'other' filter bug on listing page
Browse files Browse the repository at this point in the history
  • Loading branch information
arc12012 committed Apr 4, 2017
1 parent 0455983 commit 991fb38
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions WebContent/html/javascript/listing.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ function applyFilter() {
if (activeHOptions[j] == devices[i].hardware){
hardwareMatch = true;
}
// now we must handle the 'other' case
// there is no 'other' catagory, so if that is the option selected we must make sure
// that the device in question is not one of the categories we DO have options for
if(activeHOptions[j] === 'Other')
{
var othermatch = true;
for (var k = 0; k < hardwareOptions.length; k++) {
if(devices[i].hardware == hardwareOptions[k].getAttribute('data-type'))
othermatch = false;
}
if(othermatch) hardwareMatch = true;
}
}
if (activeHOptions.length == 0) {
Expand All @@ -121,6 +133,18 @@ function applyFilter() {
if (activeSOptions[j] == devices[i].manufacturer){
softwareMatch = true;
}
// now we must handle the 'other' case
// there is no 'other' catagory, so if that is the option selected we must make sure
// that the device in question is not one of the categories we DO have options for
if(activeSOptions[j] === 'Other')
{
var othermatch = true;
for (var k = 0; k < softwareOptions.length; k++) {
if(devices[i].manufacturer == softwareOptions[k].getAttribute('data-type'))
othermatch = false;
}
if(othermatch) softwareMatch = true;
}
}
if (activeSOptions.length == 0) {
Expand Down

0 comments on commit 991fb38

Please sign in to comment.