- when filtering the select list, keep track of values we already displayed and don't display them again
This commit is contained in:
ccooper%deadsquid.com 2007-06-01 17:36:21 +00:00
Родитель 47cb63b84d
Коммит c8f64e7dab
4 изменённых файлов: 46 добавлений и 15 удалений

Просмотреть файл

@ -15,13 +15,21 @@ var showAll = function(err) {
};
var doFilterList = function(req) {
var subgroups = req.responseText.split("\n");
var subgroupbox = document.getElementById("subgroup_id");
for (var i=0; i<subgroupbox.options.length; i++) {
var subgroup = subgroupbox.options[i];
var hide = 0;
var id = subgroup.value;
if (subgroups.indexOf(id) == -1) { hide = 1; }
var subgroups = req.responseText.split("\n");
var subgroupbox = document.getElementById("subgroup_id");
var alreadySeen = new Object;
for (var i=0; i<subgroupbox.options.length; i++) {
var subgroup = subgroupbox.options[i];
var hide = 0;
var id = subgroup.value;
if (alreadySeen[id]) {
hide = 1;
} else {
alreadySeen[id] = 1;
if (subgroups.indexOf(id) == -1) {
hide = 1;
}
}
hide == 1 ? subgroup.style.display = 'none' : subgroup.style.display = '';
}
toggleMessage('none');

Просмотреть файл

@ -18,14 +18,20 @@ var doFilterList = function(req) {
var tests = req.responseText.split("\n");
var testbox = document.getElementById("test_run_id");
var testsVisible = 0;
var alreadySeen = new Object;
for (var i=1; i<testbox.options.length; i++) {
var test = testbox.options[i];
var hideTest = 0;
var hide = 0;
var id = test.value;
if (tests.indexOf(id) == -1) {
hideTest = 1;
if (alreadySeen[id]) {
hide = 1;
} else {
alreadySeen[id] = 1;
if (tests.indexOf(id) == -1) {
hide = 1;
}
}
hideTest == 1 ? test.style.display = 'none' : test.style.display = '';
hide == 1 ? test.style.display = 'none' : test.style.display = '';
if (test.style.display != 'none') {
testsVisible = 1;
}

Просмотреть файл

@ -23,11 +23,20 @@ var doFilterList = function(req) {
var testbox = document.getElementById("testcase_id");
var l = testbox.options.length;
var hideTest;
var alreadySeen = new Object;
for (var i=0; i<l; i++) {
var test = testbox.options[i];
if (tests.indexOf(test.value) == -1) { hideTest = 1; }
else { hideTest=0 }
hideTest == 1 ? test.style.display = 'none' : test.style.display = '';
var hide = 0;
var id = test.value;
if (alreadySeen[id]) {
hide = 1;
} else {
alreadySeen[id] = 1;
if (tests.indexOf(test.value) == -1) {
hide = 1;
}
}
hide == 1 ? test.style.display = 'none' : test.style.display = '';
}
enableForm(formName);
toggleMessage('none');

Просмотреть файл

@ -17,11 +17,19 @@ var showAll = function(err) {
var doFilterList = function(req) {
var testgroups = req.responseText.split("\n");
var testgroupbox = document.getElementById("testgroup_id");
var alreadySeen = new Object;
for (var i=0; i<testgroupbox.options.length; i++) {
var testgroup = testgroupbox.options[i];
var hide = 0;
var id = testgroup.value;
if (testgroups.indexOf(id) == -1) { hide = 1; }
if (alreadySeen[id]) {
hide = 1;
} else {
alreadySeen[id] = 1;
if (testgroups.indexOf(id) == -1) {
hide = 1;
}
}
hide == 1 ? testgroup.style.display = 'none' : testgroup.style.display = '';
}
toggleMessage('none');