From 6cb7e19c0547fe739972972bd3b7a98dc46c50b2 Mon Sep 17 00:00:00 2001 From: John Costa Date: Sun, 16 Apr 2017 23:27:24 -0400 Subject: [PATCH] fixed a problem with other manufacturer in request, fixed listing popup --- WebContent/html/javascript/listing.jsp | 2 +- WebContent/html/javascript/request.jsp | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/WebContent/html/javascript/listing.jsp b/WebContent/html/javascript/listing.jsp index 256995b..e4e2c10 100644 --- a/WebContent/html/javascript/listing.jsp +++ b/WebContent/html/javascript/listing.jsp @@ -67,7 +67,7 @@ function show(deviceArray){ var part2 = "');" for (var i = 0; i < deviceArray.length; i++) { - html += '
' + deviceArray[i].name + '

' + deviceArray[i].description + '



' + html += '
' + deviceArray[i].name + '

' + deviceArray[i].description + '



' } document.getElementById('devContainer').innerHTML = html; var anchors = document.getElementsByClassName('availableAnchor'); diff --git a/WebContent/html/javascript/request.jsp b/WebContent/html/javascript/request.jsp index 8993184..6e050fe 100644 --- a/WebContent/html/javascript/request.jsp +++ b/WebContent/html/javascript/request.jsp @@ -94,21 +94,21 @@ function filter(deviceArray) { if (activeHOptions.length == 0) { hardwareMatch = true; } + for(var j = 0; j < activeSOptions.length; j++) { + 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; - } - for(var j = 0; j < activeSOptions.length; j++) { - if (activeSOptions[j] == deviceArray[i].manufacturer){ - softwareMatch = true; + 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) {