From: Mischa POSLAWSKY Date: Tue, 7 Dec 2010 22:37:28 +0000 (+0100) Subject: browser: search browser platform X-Git-Tag: v1.4~39 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/a3ffb22a8e1234cc85cd1d098ed9ff70cac5c51e browser: search browser platform --- diff --git a/browser.plp b/browser.plp index 8b08b86..f6de595 100644 --- a/browser.plp +++ b/browser.plp @@ -119,7 +119,7 @@ my $header = join('', sprintf('%s', scalar @{ $versions{$_} }, join(' ', map {"b-a-$_"} grep {$_} - $_, $caniuse->{agents}->{$_}->{prefix}, + $_, @{ $caniuse->{agents}->{$_} }{'prefix', 'type'}, ), join(' ', sprintf('%.1f%%', sum(values %{ $canihas->{$_} })), diff --git a/searchlocal.js b/searchlocal.js index 8c33f8d..752a3ee 100644 --- a/searchlocal.js +++ b/searchlocal.js @@ -29,20 +29,16 @@ function filtercell(el, set, action) { } function filtercols(table, match, action) { - var matchloc; + var matchloc = []; for (var y = 0; y < table.rows.length; y++) { var loc = 0; for (var x = 0; x < table.rows[y].cells.length; x++) { var cell = table.rows[y].cells[x]; - if (y == 0) { - if (match(cell)) { - if (!matchloc) matchloc = [loc]; - matchloc[1] = loc + cell.colSpan; - filtercell(table.children.item(x), true, action); // colgroup - } + if (y == 0 && match(cell)) { + for (var i = loc; i < loc + cell.colSpan; i++) matchloc[i] = true; + filtercell(table.children.item(x), true, action); // colgroup } - var keep = matchloc && loc >= matchloc[0] && loc < matchloc[1]; - filtercell(cell, keep, action); + filtercell(cell, matchloc[loc], action); loc += cell.colSpan; } }