Making testing in IE a tiny bit less painful.

The super handy quick filter that Marc added in 57c16b7345 was causing a bit of trouble in IE.  First, `input` was undefined where it was used as a misspelling for `window`.  After that, IE choked on the nice CSS3 selector when filtering the test list.  It turns out we don't need to be as selective and can treat all anchor elements within the table rows as candidates.
This commit is contained in:
tschaub
2012-03-02 18:29:25 -07:00
parent 9b2e46d9c5
commit 59578931c2

View File

@@ -141,7 +141,7 @@ Test.AnotherWay.quicksearch = function(){
Test.AnotherWay.filterTestList = function(str){
Test.AnotherWay.unfilterTestList();
var re = new RegExp(str, 'i');
var candidates = document.querySelectorAll('#testtable tr td:nth-child(2) a');
var candidates = document.querySelectorAll('#testtable tr a');
for (var idx = 0, len = candidates.length; idx<len; idx++) {
var tr = candidates[idx].parentNode.parentNode;
var html = candidates[idx].innerHTML;
@@ -164,10 +164,10 @@ Test.AnotherWay.unfilterTestList = function() {
};
// bind our quicksearch init method to body onload.
(function(win){
(function(win) {
if (win.addEventListener) {
win.addEventListener('load', Test.AnotherWay.bindQuicksearchListener);
} else if (input.attachEvent) {
} else if (win.attachEvent) {
win.attachEvent('onload', Test.AnotherWay.bindQuicksearchListener);
} else {
win.onload = function(){